2.2.1中骨骼動畫釋放不徹底,須要更改源碼進行手動釋放,釋放方法不能放在析構函數和onExit()函數中。函數
第一步修改源碼:文件位置:extensions/CocoStudio/Armature/utils/CCDataReaderHelper.cpp;動畫
if (pAsyncStruct->imagePath != "" && pAsyncStruct->plistPath != ""){ pthread_mutex_lock(&s_GetFileDataMutex);
(刪除)CCArmatureDataManager::sharedArmatureDataManager()->addSpriteFrameFromFile(pAsyncStruct->plistPath.c_str(), pAsyncStruct->imagePath.c_str());
(更改成)CCArmatureDataManager::sharedArmatureDataManager()->addSpriteFrameFromFile(pAsyncStruct->plistPath.c_str(), pAsyncStruct->imagePath.c_str(), pDataInfo->filename.c_str()); pthread_mutex_unlock(&s_GetFileDataMutex); } CCDataReaderHelper::addDataAsyncCallBack(float dt) { std::string configPath = pDataInfo->configFileQueue.front(); pthread_mutex_lock(&s_GetFileDataMutex); (刪除)CCArmatureDataManager::sharedArmatureDataManager()->addSpriteFrameFromFile((pAsyncStruct->baseFilePath + configPath + ".plist").c_str(), (pAsyncStruct->baseFilePath + configPath + ".png").c_str()); (更改成)CCArmatureDataManager::sharedArmatureDataManager()->addSpriteFrameFromFile((pAsyncStruct->baseFilePath + configPath + ".plist").c_str(), (pAsyncStruct->baseFilePath + configPath + ".png").c_str(), pDataInfo->filename.c_str()); pthread_mutex_unlock(&s_GetFileDataMutex); pDataInfo->configFileQueue.pop(); }
第二步在刪除骨骼動畫的函數中調用:spa
armature->removeFromParent();
CCArmatureDataManager::sharedArmatureDataManager()->removeArmatureFileInfo("Armature/123/123.ExportJson");
CCTextureCache::sharedTextureCache()->removeAllTextures();code
骨骼動畫釋放完成。blog