linuxgurugamer / KCT

Kerbal Construction Time - An addon for Kerbal Space Program
GNU General Public License v3.0
11 stars 15 forks source link

Remove `new GUIStyle()` calls from UI updates #92

Closed siimav closed 1 year ago

siimav commented 2 years ago

The Principia developers found out that GUIStyle instances are not GC'ed correctly and thus will cause serious memory leaks when continously allocated from the Update cycle. I found a couple of instances of this happening in the RP-1 fork so I believe that yours is affected as well.

linuxgurugamer commented 2 years ago

That's an old issue on many mods. If someone isn't careful, that happens a lot. Thanks for the update, I'll take a look, but if you could let me know where you found it, might save me some time

siimav commented 2 years ago

I haven't looked through the code on your fork but I believe that KCT_GUI_BuildList and KCT_GUI_Presets are affected.

linuxgurugamer commented 1 year ago

Just so you know, I've just finished reviewing the code. Looks like I had fixed this a while ago, but I did find one outlier which I fixed. Thanks