We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent dfac241 commit b4aba4cCopy full SHA for b4aba4c
cocos2dx/textures/CCTextureCache.cpp
@@ -214,6 +214,16 @@ CCTexture2D * CCTextureCache::addImage(const char * path)
214
texture = new CCTexture2D();
215
texture->initWithImage(image);
216
CCX_SAFE_DELETE(image);// image->release();
217
+
218
+ if( texture )
219
+ {
220
+ m_pTextures->setObject(texture, fullpath);
221
+ texture->release();
222
+ }
223
+ else
224
225
+ CCLOG("cocos2d: Couldn't add image:%s in CCTextureCache", path);
226
227
}
228
else
229
{
@@ -237,7 +247,7 @@ CCTexture2D * CCTextureCache::addImage(const char * path)
237
247
if( texture )
238
248
239
249
m_pTextures->setObject(texture, fullpath);
240
- texture->autorelease();
250
241
251
242
252
243
253
0 commit comments