From 206e158596112c7a9f49497ab346c66470225d5c Mon Sep 17 00:00:00 2001 From: honghui Date: Thu, 25 Sep 2014 12:01:16 +0800 Subject: [PATCH] performance improvement for lua runtime on Run mode --- .../frameworks/runtime-src/Classes/runtime/Runtime.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/templates/lua-template-runtime/frameworks/runtime-src/Classes/runtime/Runtime.cpp b/templates/lua-template-runtime/frameworks/runtime-src/Classes/runtime/Runtime.cpp index c7181cdfb6..8b07d81830 100644 --- a/templates/lua-template-runtime/frameworks/runtime-src/Classes/runtime/Runtime.cpp +++ b/templates/lua-template-runtime/frameworks/runtime-src/Classes/runtime/Runtime.cpp @@ -92,6 +92,8 @@ void startScript(string strDebugArg) auto engine = LuaEngine::getInstance(); if (!strDebugArg.empty()) { + // open debugger.lua module + luaopen_debugger(engine->getLuaStack()->getLuaState()); engine->executeString(strDebugArg.c_str()); } cocos2d::log("debug args = %s", strDebugArg.c_str()); @@ -1213,9 +1215,7 @@ void initRuntime() auto engine = LuaEngine::getInstance(); ScriptEngineManager::getInstance()->setScriptEngine(engine); - LuaStack* stack = engine->getLuaStack(); - register_runtime_override_function(stack->getLuaState()); - luaopen_debugger(engine->getLuaStack()->getLuaState()); + register_runtime_override_function(engine->getLuaStack()->getLuaState()); static ConsoleCustomCommand *g_customCommand; g_customCommand = new ConsoleCustomCommand();