From 0c0f241c5e18f3a7b9c50313caf5058aa2ba7b79 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=82=96=E5=B3=B0?= Date: Wed, 30 Dec 2015 19:42:19 +0800 Subject: [PATCH] Fix pre-compiled frame work js project will crash when exit on MacOS --- .../frameworks/runtime-src/proj.ios_mac/mac/SimulatorApp.mm | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tools/simulator/frameworks/runtime-src/proj.ios_mac/mac/SimulatorApp.mm b/tools/simulator/frameworks/runtime-src/proj.ios_mac/mac/SimulatorApp.mm index 0a04d97885..c692779e80 100755 --- a/tools/simulator/frameworks/runtime-src/proj.ios_mac/mac/SimulatorApp.mm +++ b/tools/simulator/frameworks/runtime-src/proj.ios_mac/mac/SimulatorApp.mm @@ -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]; }