Popping a Scene without destroying it; Things I didn’t know about Cocos2d-x, but I probably could have read in the docs somewhere #4

If you have the same Scene on the Director’s Scene stack, either by runWithScene or with pushScene, if you pop one off, it’ll call release on it, and effectively destroy it, making any further operations on the Scene impossible.

To resolve this, you need to call retain() on the scene, to tell cocos that somewhere else is using the scene.

Leave a Reply

Your email address will not be published.