cocos2d-x 内存泄漏2

 

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;
    //}
}

}

posted @ 2024-04-28 14:29  YZFHKMS-X  阅读(10)  评论(0编辑  收藏  举报