fixed #484: solve a potential issue

This commit is contained in:
minggo 2011-05-06 18:09:31 +08:00
parent 857141eef3
commit 113f1ab2ef
1 changed files with 4 additions and 0 deletions

View File

@ -152,6 +152,10 @@ bool CCTextureAtlas::initWithTexture(CCTexture2D *texture, unsigned int capacity
//CCLOG("cocos2d: CCTextureAtlas: not enough memory");
CC_SAFE_FREE(m_pQuads)
CC_SAFE_FREE(m_pIndices)
// release texture, should set it to null, because the destruction will
// release it too. see cocos2d-x issue #484
CC_SAFE_RELEASE_NULL(m_pTexture);
return false;
}