Skip to content

Commit

Permalink
applied on freeplay gc things to new version
Browse files Browse the repository at this point in the history
  • Loading branch information
HRK-EXEX committed Dec 24, 2024
1 parent 993f2c1 commit 29831ec
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
13 changes: 13 additions & 0 deletions source/mikolka/vslice/freeplay/FreeplayState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,14 @@ class FreeplayState extends MusicBeatSubstate

override function create():Void
{
Paths.clearStoredMemory();
Paths.clearUnusedMemory();

if (ClientPrefs.data.disableGC) {
MemoryUtil.compact();
MemoryUtil.disable();
}

//? Psych might've reloaded the mod list. Make sure we select current character's mod for the style
var saveBox = VsliceOptions.LAST_MOD;
if (ModsHelper.isModDirEnabled(saveBox.mod_dir))
Expand Down Expand Up @@ -812,6 +820,11 @@ class FreeplayState extends MusicBeatSubstate
add(missingText);
missingTextBG.cameras = [FlxG.cameras.list[FlxG.cameras.list.length - 1]];
missingText.cameras = [FlxG.cameras.list[FlxG.cameras.list.length - 1]];

if (ClientPrefs.data.disableGC && !MemoryUtil.isGcEnabled) {
MemoryUtil.enable();
MemoryUtil.collect(true);
}
}

var currentFilter:SongFilter = null;
Expand Down
2 changes: 1 addition & 1 deletion source/states/FreeplayState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ class FreeplayState extends MusicBeatState
Paths.clearStoredMemory();
Paths.clearUnusedMemory();

if (ClientPrefs.data.disableGC && !MemoryUtil.isGcEnabled) {
if (ClientPrefs.data.disableGC) {
MemoryUtil.compact();
MemoryUtil.disable();
}
Expand Down

0 comments on commit 29831ec

Please sign in to comment.