cocos2d-x has its memory management learning from NSAutoreleasePool in ios, called CCAutoreleasePool.
The previous discuss is here http://www.cocos2d-x.org/boards/6/topics/678?r=696Take care of the RefCount of CCObjects, when is RefCount is reduce to 0, the object will call “delete this;”
CCObject’s constructor, retain, release, autorelease will affect the RefCount.
If you get the object from static methods such as CCSprite::spriteFromABC(…), then the object~~>autorelease is already invoked once. You don’t need to call object~~>release() otherwise you call object->retain() before.