i don't know if these changes reduce the memory leak

This commit is contained in:
2024-10-20 08:24:07 -05:00
parent d63895a1fe
commit 2d904b6bd9
2 changed files with 4 additions and 1 deletions

View File

@@ -13,6 +13,8 @@ class HFlxGame extends FlxGame {
public function new(gameWidth = 0, gameHeight = 0, ?initialState:Class<FlxState>, updateFramerate = 60, drawFramerate = 60, skipSplash = false, startFullscreen = false) {
super(gameWidth, gameHeight, initialState, updateFramerate, drawFramerate, skipSplash, startFullscreen);
// Is this a one-line fix for the memory leak?
openfl.Assets.cache.enabled = false;
}
override function step():Void

View File

@@ -880,7 +880,8 @@
(doFor =>key lightSourceList lightSources
(whileLet [lightSource (lightSourceList.elements.pop)]
(lightSource.destroy)))
(flixel.FlxG.bitmap.clearCache)
(#when cpp
(cpp.vm.Gc.run true)
(cpp.vm.Gc.compact)))