Skip to content

Commit 9fd1814

Browse files
committed
Memory.
1 parent 09a28c4 commit 9fd1814

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

source/states/PlayState.hx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6576,6 +6576,9 @@ class PlayState extends MusicBeatState
65766576
instance = null;
65776577
super.destroy();
65786578
endingSong = true;
6579+
6580+
yutautil.MemoryHelper.clearMemoryStored();
6581+
65796582
}
65806583

65816584
var lastStepHit:Int = -1;

source/yutautil/MemoryHelper.hx

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,4 +57,12 @@ class MemoryHelper {
5757
clearObject(object);
5858
}
5959
}
60+
61+
public static function clearMemoryStored():Void {
62+
cpp.vm.Gc.compact();
63+
cpp.vm.Gc.run(false);
64+
cpp.vm.Gc.run(true);
65+
trace("Memory cleared");
66+
}
67+
6068
}

0 commit comments

Comments
 (0)