15 lines
278 B
Haxe
Raw Normal View History

2025-01-22 16:18:30 +01:00
class Tools {
private static var onExit:Array<Int->Void> = [];
public static function addOnExitHook(fn:Int->Void) {
onExit.push(fn);
}
public static function exit(exitCode:Int) {
for (hook in onExit) {
hook(exitCode);
}
Sys.exit(exitCode);
}
}