I think I might be causing a bug in my code because I’m unclear about what the cleanup: part of removeChild:cleanup: method of cocos2d ccnode class.
Thanks.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
It stops all actions and unschedules any scheduled selectors associated with the CCNode, basically removing any references that cocos could have to the object. It also propagates the cleanup invocation to all of the object’s children. If the object is an autorealease-able object and you did not retain a reference to it, the memory should be reclaimed by the objective-c runtime, for the object itself and its children. That would be true of almost all objects, but not if you added the objected as a targeted touch delegate. In that case, I would recommend to override the onExit method as this:
this way, the object will be fully release-able when you cleanup.