Fix pre-compiled frame work js project will crash when exit on MacOS

This commit is contained in:
肖峰 2015-12-30 19:42:19 +08:00
parent efbbdb1f58
commit 0c0f241c5e
1 changed files with 2 additions and 0 deletions

View File

@ -452,6 +452,7 @@ static void glfwDropFunc(GLFWwindow *window, int count, const char **files)
RuntimeEngine::getInstance()->setProjectConfig(_project);
Application::getInstance()->run();
CC_SAFE_DELETE(_app);
// After run, application needs to be terminated immediately.
[NSApp terminate: self];
}
@ -705,6 +706,7 @@ static void glfwDropFunc(GLFWwindow *window, int count, const char **files)
-(IBAction)onFileClose:(id)sender
{
CC_SAFE_DELETE(_app);
[[NSApplication sharedApplication] terminate:self];
}