>What should i do? how to make sure the memory is deallocated?
You can make temporary change in cocos2dx sources: insert static variable
int s_count into CCNode class, increment it in CCNode constructor, decrement in destructor and print it somewhere else (or right in destructor).
You also can go further and create static variable
std::set<CCNode *> s_instances with all alive instances of CCNode, and track which nodes are not deleted in debugger.
P.S. After calling
new object has
retainsCount() == 1, and CCDictionary increments retain count on adding / decrements on removal. So you should call
obj->release() after adding to CCDictionary.