cocos2d\cocos\base/CCScriptSupport.cpp
{
ScriptEngineManager* ScriptEngineManager::getInstance()
{
if (!s_pSharedScriptEngineManager)
{
static ScriptEngineManager obj;
//s_pSharedScriptEngineManager = new (std::nothrow) ScriptEngineManager();
s_pSharedScriptEngineManager = &obj;
}
return s_pSharedScriptEngineManager;
}
void g_destroyInstance()
{
ScriptEngineManager::getInstance()->removeScriptEngine();
}
void ScriptEngineManager::destroyInstance()
{
g_destroyInstance();
//if (s_pSharedScriptEngineManager)
//{
// delete s_pSharedScriptEngineManager;
// s_pSharedScriptEngineManager = nullptr;
//}
}
}
标签:泄漏,obj,getInstance,destroyInstance,内存,cocos2d,pSharedScriptEngineManager,ScriptE From: https://www.cnblogs.com/YZFHKMS-X/p/18163688