Skip to content

Commit

Permalink
Fix window not closing when specified
Browse files Browse the repository at this point in the history
  • Loading branch information
Cheemsandfriends authored Oct 5, 2024
1 parent bc546e8 commit 0d60929
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion source/funkin/ui/title/TitleState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ class TitleState extends MusicBeatState
#if desktop
if (FlxG.keys.justPressed.ESCAPE)
{
Sys.exit(0);
openfl.Lib.application.window.close();
}
#end

Expand Down
9 changes: 8 additions & 1 deletion source/funkin/util/logging/CrashHandler.hx
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,12 @@ class CrashHandler
{
trace('Error while handling crash: ' + e);
}

#if sys
Sys.sleep(1); // wait a few moments of margin to process.
// Exit the game. Since it threw an error, we use a non-zero exit code.
openfl.Lib.application.window.close();
#end
}

static function onCriticalError(message:String):Void
Expand All @@ -83,8 +89,9 @@ class CrashHandler
}

#if sys
Sys.sleep(1); // wait a few moments of margin to process.
// Exit the game. Since it threw an error, we use a non-zero exit code.
Sys.exit(1);
openfl.Lib.application.window.close();
#end
}

Expand Down

0 comments on commit 0d60929

Please sign in to comment.