Merge pull request #1097 from walzer/gles20

fixed #1095 on github issue, which is issue #1395 in cocos2d-x issue system
This commit is contained in:
Walzer 2012-07-14 00:08:56 -07:00
commit 3ea9874e2f
1 changed files with 3 additions and 3 deletions

View File

@ -444,9 +444,9 @@ CCTexture2D * CCTextureCache::addImage(const char * path)
CC_SAFE_DELETE_ARRAY(pBuffer);
texture = new CCTexture2D();
texture->initWithImage(&image, resolution);
if( texture )
if( texture &&
texture->initWithImage(&image, resolution) )
{
#if CC_ENABLE_CACHE_TEXTURE_DATA
// cache the texture file name