net-lisias-ksp / DistantObject

Distant Object Enhancement (DOE) is a visual enhancement mod that makes objects realistically visible over large distances.
Other
10 stars 3 forks source link

Memory leak from settings window #36

Closed JonnyOThan closed 11 months ago

JonnyOThan commented 1 year ago

I see this a lot in people's logs:

[KSPCF:MemoryLeaks] A destroyed DistantObject:SettingsGui instance is owning a onGUIApplicationLauncherDestroyed GameEvents callback. No action has been taken, but unless this mod is relying on this pattern, this is likely a memory leak.

The settings gui class never unhooks its event handler so it never gets garbage collected.

Lisias commented 11 months ago

@JonnyOThan , sorry for being so late. I just detected this while doing Support on an unrelated problem and when I came back here to publish the release, I got aware of your issue.

Anyway, thank you for the report and my apologies for not detecting it sooner - may I ask you to next time mention me (@Lisias) on the issue? This way github will warn me about and I will not miss it, as it happened today!

In a way or another, it's fixed and available on the Releases page!