Cleaner exit

This commit is contained in:
Joshua Granick
2015-08-20 14:46:44 -07:00
parent 56c0872b8a
commit 5a008fa80d
4 changed files with 24 additions and 12 deletions

View File

@@ -160,6 +160,13 @@ class FlashApplication {
} }
public function exit ():Void {
}
public function getFrameRate ():Float { public function getFrameRate ():Float {
return Lib.current.stage.frameRate; return Lib.current.stage.frameRate;

View File

@@ -162,6 +162,13 @@ class HTML5Application {
} }
public function exit ():Void {
}
public function getFrameRate ():Float { public function getFrameRate ():Float {
if (framePeriod < 0) { if (framePeriod < 0) {

View File

@@ -84,8 +84,6 @@ class NativeApplication {
if (!active) { if (!active) {
var result = lime_application_quit (handle); var result = lime_application_quit (handle);
__cleanup ();
System.exit (result); System.exit (result);
} }
@@ -100,8 +98,6 @@ class NativeApplication {
#elseif (cpp || neko) #elseif (cpp || neko)
var result = lime_application_exec (handle); var result = lime_application_exec (handle);
__cleanup ();
parent.onExit.dispatch (result); parent.onExit.dispatch (result);
return result; return result;
@@ -115,6 +111,13 @@ class NativeApplication {
} }
public function exit ():Void {
AudioManager.shutdown ();
}
public function getFrameRate ():Float { public function getFrameRate ():Float {
return frameRate; return frameRate;
@@ -133,7 +136,7 @@ class NativeApplication {
case EXIT: 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_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_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); private static var lime_application_exec = System.load ("lime", "lime_application_exec", 1);

View File

@@ -313,6 +313,8 @@ class Application extends Module {
} }
backend.exit ();
} }