Skip to content

Fix a memory leak in EditorAnimatedPartsShipModified#400

Open
Phantomical wants to merge 1 commit into
KSPModdingLibs:masterfrom
Phantomical:scalar-module-stop-leak
Open

Fix a memory leak in EditorAnimatedPartsShipModified#400
Phantomical wants to merge 1 commit into
KSPModdingLibs:masterfrom
Phantomical:scalar-module-stop-leak

Conversation

@Phantomical

Copy link
Copy Markdown
Collaborator

We were registering to IScalarModule.OnStop, assuming that the event handler was cleaned up when the part is destroyed. As it turns out, these are recycled so registering and leaving it causes a memory leak.

This modfies ScalarModuleStopListener to unsubscribe appropriately when it gets destroyed.

Fixes #399

We were registering to IScalarModule.OnStop, assuming that the event
handler was cleaned up when the part is destroyed. As it turns out,
these are recycled so registering and leaving it causes a memory leak.

This modfies ScalarModuleStopListener to unsubscribe appropriately when
it gets destroyed.

Fixes KSPModdingLibs#399
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

EditorAnimatedPartsShipModified.ScalarModuleStopListener shows up as a memory leak

1 participant