mirror of https://github.com/axmolengine/axmol.git
Merge pull request #3905 from Dhilan007/di2914
issues #2914:removeSpriteFramesFromFile() crashes if file doesn't exist
This commit is contained in:
commit
96ec8d34a9
|
@ -344,7 +344,11 @@ void SpriteFrameCache::removeSpriteFramesFromFile(const char* plist)
|
|||
{
|
||||
std::string fullPath = FileUtils::getInstance()->fullPathForFilename(plist);
|
||||
Dictionary* dict = Dictionary::createWithContentsOfFileThreadSafe(fullPath.c_str());
|
||||
|
||||
if (dict == nullptr)
|
||||
{
|
||||
CCLOG("cocos2d:SpriteFrameCache:removeSpriteFramesFromFile: create dict by %s fail.",plist);
|
||||
return;
|
||||
}
|
||||
removeSpriteFramesFromDictionary((Dictionary*)dict);
|
||||
|
||||
// remove it from the cache
|
||||
|
|
Loading…
Reference in New Issue