Looking under the hood in cocos2d-x I found multiple “delete this” coding practices. That’s bad programming. An object should not be deleting itself - ever. Let its manager manage its existance. Here is an example:
bool CCTextureAtlas::initWithFile(const char * file, unsigned int capacity)
// retained in property
CCTexture2D *texture = CCTextureCache::sharedTextureCache()->addImage(file);
return initWithTexture(texture, capacity);
CCLOG (“cocos2d: Could not open file: %s”, file);
This code leads to a sloppy bug in code that relies on this method in CCAtlasNode.
Found in latest beta release.