cocostudio内存释放

     在使用cocostudio时,在释放内存时能够这样做:

     在onExit()方法里加入例如以下:

void LoadLayer::onExit()
{
    // 释放本对象自己
    removeFromParentAndCleanup(true);
    // 清理GUI管理类(这个不要放到最后清理)
    GUIReader::shareReader()->purge();
    // 清理场景管理(全部读取的场景都会被清理掉)
    SceneReader::sharedSceneReader()->purge();
    // 清理动作(这里指Action动作,不是动作编辑器的动作。

) ActionManager::shareManager()->purge(); // 清理数据管理 DictionaryHelper::shareHelper()->purgeDictionaryHelper(); // 释放掉不用的纹理 CCTextureCache::sharedTextureCache()->removeAllTextures(); CCTextureCache::sharedTextureCache()->removeUnusedTextures(); CCLayer::onExit(); }



原文地址:https://www.cnblogs.com/bhlsheji/p/5135495.html