From e6ae45e1b2ac5f5f393f22190e58ab87df4c4bd9 Mon Sep 17 00:00:00 2001 From: Walzer Date: Sat, 14 Jul 2012 15:06:11 +0800 Subject: [PATCH] fixed issue #1395, which was reported at https://github.com/cocos2d/cocos2d-x/issues/1095 --- cocos2dx/textures/CCTextureCache.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cocos2dx/textures/CCTextureCache.cpp b/cocos2dx/textures/CCTextureCache.cpp index c03f01431e..524e1d2b68 100644 --- a/cocos2dx/textures/CCTextureCache.cpp +++ b/cocos2dx/textures/CCTextureCache.cpp @@ -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