From 4c57a29455e2cd2e3fc8181b0b7178ed99e75b6c Mon Sep 17 00:00:00 2001 From: yinjimmy Date: Tue, 30 Dec 2014 15:59:52 +0800 Subject: [PATCH] fix: init config on all platform & stop runtime when exit --- .../frameworks/runtime-src/Classes/AppDelegate.cpp | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/templates/lua-template-runtime/frameworks/runtime-src/Classes/AppDelegate.cpp b/templates/lua-template-runtime/frameworks/runtime-src/Classes/AppDelegate.cpp index c558d0a0bf..ad3ccbe940 100644 --- a/templates/lua-template-runtime/frameworks/runtime-src/Classes/AppDelegate.cpp +++ b/templates/lua-template-runtime/frameworks/runtime-src/Classes/AppDelegate.cpp @@ -21,16 +21,21 @@ using namespace std; AppDelegate::AppDelegate() { +#if (CC_TARGET_PLATFORM != CC_PLATFORM_WIN32) && (CC_TARGET_PLATFORM != CC_PLATFORM_MAC) + auto config = ConfigParser::getInstance(); + _project.setScriptFile(config->getEntryFile()); +#endif } AppDelegate::~AppDelegate() { SimpleAudioEngine::end(); -#if (COCOS2D_DEBUG > 0 && CC_CODE_IDE_DEBUG_SUPPORT > 0) - // NOTE:Please don't remove this call if you want to debug with Cocos Code IDE - endRuntime(); -#endif + if (_project.getDebuggerType() != kCCRuntimeDebuggerNone) + { + // NOTE:Please don't remove this call if you want to debug with Cocos Code IDE + endRuntime(); + } ConfigParser::purge(); }