Skip to content

Fix: Properly destroy Scene in MapWorld to prevent memory leak#81

Closed
PatrickJnr wants to merge 1 commit intoFacepunch:masterfrom
PatrickJnr:fix/mapworld-memory-leak
Closed

Fix: Properly destroy Scene in MapWorld to prevent memory leak#81
PatrickJnr wants to merge 1 commit intoFacepunch:masterfrom
PatrickJnr:fix/mapworld-memory-leak

Conversation

@PatrickJnr
Copy link
Copy Markdown
Contributor

Fixes a FIXME in MapWorld.cs where the Scene wasn't being properly destroyed.

Previously, the reference was set to null, which meant the Scene (and its native resources) hung around until the GC decided to run. This change ensures Scene.Destroy() is called immediately when the MapWorld is destroyed.

Copy link
Copy Markdown
Member

@handsomematt handsomematt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense, thank you

@handsomematt handsomematt added triaged triaged pull-requests are replicated on the internal sbox repo and removed triaged triaged pull-requests are replicated on the internal sbox repo labels Dec 4, 2025
@handsomematt handsomematt force-pushed the fix/mapworld-memory-leak branch from 5d2595b to 97e71f0 Compare December 4, 2025 11:24
@handsomematt handsomematt removed the triaged triaged pull-requests are replicated on the internal sbox repo label Dec 4, 2025
@PatrickJnr
Copy link
Copy Markdown
Contributor Author

Thanks @handsomematt

@handsomematt handsomematt added the triaged triaged pull-requests are replicated on the internal sbox repo label Dec 4, 2025
@PatrickJnr PatrickJnr force-pushed the fix/mapworld-memory-leak branch from cbf5852 to 4a733d1 Compare December 5, 2025 09:08
@handsomematt handsomematt added triaged triaged pull-requests are replicated on the internal sbox repo and removed triaged triaged pull-requests are replicated on the internal sbox repo labels Dec 5, 2025
@handsomematt handsomematt force-pushed the fix/mapworld-memory-leak branch from 4a733d1 to e309743 Compare December 5, 2025 11:56
@handsomematt handsomematt added triaged triaged pull-requests are replicated on the internal sbox repo and removed triaged triaged pull-requests are replicated on the internal sbox repo labels Dec 5, 2025
@sboxbot sboxbot added the accepted this pull request was accepted, hurrah! label Dec 5, 2025
@sboxbot
Copy link
Copy Markdown
Contributor

sboxbot commented Dec 5, 2025

This PR has been merged upstream.

@sboxbot sboxbot closed this Dec 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

accepted this pull request was accepted, hurrah! triaged triaged pull-requests are replicated on the internal sbox repo

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants