зеркало из https://github.com/microsoft/cocos2d-x.git
Merge pull request #6151 from mgcL/ScriptHandlerMgr-memory-free
add destroyInstance for ScriptHandlerMgr
This commit is contained in:
Коммит
28ebec46dc
|
@ -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();
|
||||
|
|
|
@ -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);
|
||||
|
|
Загрузка…
Ссылка в новой задаче