The CCScene Liberator follows the same rules as any other object. It will work when the reference count for CCScene reaches zero.
The default scene does not care about another, which is about to replace it, but if you change the scene with a transition, there will be a period of time when two scenes exist simultaneously. When the transition is completed, the transition will release its link to the first scene, which is likely to be the last such link, and the first scene will be released.
In your scene de-locator, put CCLOG to see when it starts. I put one in each to make sure.
In the general case, manually release any object created using a method starting with alloc
, new
or copy
, whether it is a Cocos2D object or otherwise. Other creation methods, such as Cocos2D node
, do not require a manual version if you yourself did not select the retain
object manually, which may be useful if you are not going to add it as a child to another node immediately.
As you said, adding node as a child of another does not mean that it needs an additional release
; Cocos2D will work with this.
source share