Skip to content

Commit d062c08

Browse files
committed
Added "requires super" attribute to cleanup method
The need to call [super cleanup] needs to be forced, or at a a minimum, encouraged by the compiler so that subclasses behave as expected by the framework.
1 parent fc05eb0 commit d062c08

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

cocos2d/CCNode_Private.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,9 +92,9 @@ CGAffineTransform CGAffineTransformMakeRigid(CGPoint translate, CGFloat radians)
9292
/* Event that is called when the running node is no longer running (eg: its CCScene is being removed from the "stage" ).
9393
On cleanup you should break any possible circular references.
9494
CCNode's cleanup removes any possible scheduled timer and/or any possible action.
95-
If you override cleanup, you shall call [super cleanup]
95+
If you override cleanup, you must call [super cleanup] <em>after</em> any cleanup of your own.
9696
*/
97-
-(void) cleanup;
97+
-(void) cleanup __attribute__((objc_requires_super));
9898

9999
///* performs OpenGL view-matrix transformation of its ancestors.
100100
// Generally the ancestors are already transformed, but in certain cases (eg: attaching a FBO) it is necessary to transform the ancestors again.

0 commit comments

Comments
 (0)