cocos2dx 销毁对象方式

内容纲要

// 释放场景对象自己
    scene->removeFromParentAndCleanup(true);
     
    // 清理GUI管理类(这个不要放到最后清理)
    GUIReader::getInstance()->destroyInstance();
     
    // 清理场景管理(所有读取的场景都会被清理掉)
    SceneReader::getInstance()->destroyInstance();
     
    // 清理动作(这里指Action动作,不是动作编辑器的动作。)
    Director::getInstance()->getActionManager()->removeAllActions();
     
    // 清除动画数据
    ArmatureDataManager::getInstance()->destroyInstance();
     
    // 清理数据管理
    DictionaryHelper::getInstance()->destroyInstance();
     
    // 清理精灵帧
    SpriteFrameCache::getInstance()->destroyInstance();
     
    // 清理纹理
    Director::getInstance()->getTextureCache()->removeAllTextures();

发表回复