diff --git a/cocos/scripting/lua-bindings/manual/LuaScriptHandlerMgr.cpp b/cocos/scripting/lua-bindings/manual/LuaScriptHandlerMgr.cpp index 5d571b778e..6f5fa121e4 100644 --- a/cocos/scripting/lua-bindings/manual/LuaScriptHandlerMgr.cpp +++ b/cocos/scripting/lua-bindings/manual/LuaScriptHandlerMgr.cpp @@ -124,10 +124,11 @@ ScriptHandlerMgr::ScriptHandlerMgr() { } + ScriptHandlerMgr::~ScriptHandlerMgr() { - CC_SAFE_DELETE(_scriptHandlerMgr); } + ScriptHandlerMgr* ScriptHandlerMgr::getInstance() { if (NULL == _scriptHandlerMgr) @@ -138,6 +139,11 @@ ScriptHandlerMgr* ScriptHandlerMgr::getInstance() return _scriptHandlerMgr; } +void ScriptHandlerMgr::destroyInstance() +{ + CC_SAFE_DELETE(_scriptHandlerMgr); +} + void ScriptHandlerMgr::init() { _mapObjectHandlers.clear(); diff --git a/cocos/scripting/lua-bindings/manual/LuaScriptHandlerMgr.h b/cocos/scripting/lua-bindings/manual/LuaScriptHandlerMgr.h index f367859afc..aab6f716ae 100644 --- a/cocos/scripting/lua-bindings/manual/LuaScriptHandlerMgr.h +++ b/cocos/scripting/lua-bindings/manual/LuaScriptHandlerMgr.h @@ -173,7 +173,8 @@ public: ScriptHandlerMgr(void); virtual ~ScriptHandlerMgr(void); static ScriptHandlerMgr* getInstance(void); - + static void destroyInstance(void); + void addObjectHandler(void* object,int handler,ScriptHandlerMgr::HandlerType handlerType); void removeObjectHandler(void* object,ScriptHandlerMgr::HandlerType handlerType); int getObjectHandler(void* object,ScriptHandlerMgr::HandlerType handlerType);