Hey guys I was wondering if someone could clarify this for me. When you replace a scene is just the scene and the children of the scene released. or is everything released (variables that havent been added as children)?
replace scene?
(3 posts) (3 voices)-
Posted 6 months ago #
-
scene and children are released for sure. By variables you mean what? Autorelease objects will be released. You need to specifically release other objects (non-autorelease objects).
SpriteLogic
Posted 6 months ago # -
@firephysics: The general rule of thumb is that if you have directly retained (through retain, copy, or alloc) an object, you are responsible for releasing it. The object will leak if you retain without a release. Anything you did NOT directly retain will autorelease on its own. If you have variables that you have NOT called alloc/init on and not retained should be released when a scene is replaced, as long as you have not held a reference to it somewhere else.
Check Instruments->Leaks to see if you have anything leaky. If something leaks, then you usually need to release something that you missed.
Posted 6 months ago #
Reply
You must log in to post.