Cocos2d-x: should all the added children be removed MANUALLY when deallocing a CCNode object

312 views Asked by At

The case is that I have a CCLayer created with cocosBuilder, and there are children added either programmatically or initially using the builder. I am not sure if the children would be released correctly if I do not remove all of them manually.

2

There are 2 answers

0
Eklavyaa On

But I think we should remove them if we are adding them to the main game layer very frequently . As with time there will be lots of them waiting to be removed,which may increase memory usage.

0
CodeSmile On

You do not need to remove them manually. Each node removes its children (empties the children array) when it deallocates.