Cleaner exit
This commit is contained in:
@@ -160,6 +160,13 @@ class FlashApplication {
|
||||
}
|
||||
|
||||
|
||||
public function exit ():Void {
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
public function getFrameRate ():Float {
|
||||
|
||||
return Lib.current.stage.frameRate;
|
||||
|
||||
@@ -162,6 +162,13 @@ class HTML5Application {
|
||||
}
|
||||
|
||||
|
||||
public function exit ():Void {
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
public function getFrameRate ():Float {
|
||||
|
||||
if (framePeriod < 0) {
|
||||
|
||||
@@ -84,8 +84,6 @@ class NativeApplication {
|
||||
if (!active) {
|
||||
|
||||
var result = lime_application_quit (handle);
|
||||
__cleanup ();
|
||||
|
||||
System.exit (result);
|
||||
|
||||
}
|
||||
@@ -100,8 +98,6 @@ class NativeApplication {
|
||||
#elseif (cpp || neko)
|
||||
|
||||
var result = lime_application_exec (handle);
|
||||
__cleanup ();
|
||||
|
||||
parent.onExit.dispatch (result);
|
||||
|
||||
return result;
|
||||
@@ -115,6 +111,13 @@ class NativeApplication {
|
||||
}
|
||||
|
||||
|
||||
public function exit ():Void {
|
||||
|
||||
AudioManager.shutdown ();
|
||||
|
||||
}
|
||||
|
||||
|
||||
public function getFrameRate ():Float {
|
||||
|
||||
return frameRate;
|
||||
@@ -133,7 +136,7 @@ class NativeApplication {
|
||||
|
||||
case EXIT:
|
||||
|
||||
parent.onExit.dispatch (0);
|
||||
//parent.onExit.dispatch (0);
|
||||
|
||||
}
|
||||
|
||||
@@ -492,13 +495,6 @@ class NativeApplication {
|
||||
}
|
||||
|
||||
|
||||
private function __cleanup ():Void {
|
||||
|
||||
AudioManager.shutdown ();
|
||||
|
||||
}
|
||||
|
||||
|
||||
private static var lime_application_create = System.load ("lime", "lime_application_create", 1);
|
||||
private static var lime_application_event_manager_register = System.load ("lime", "lime_application_event_manager_register", 2);
|
||||
private static var lime_application_exec = System.load ("lime", "lime_application_exec", 1);
|
||||
|
||||
@@ -313,6 +313,8 @@ class Application extends Module {
|
||||
|
||||
}
|
||||
|
||||
backend.exit ();
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user