Transition crash

Transition crash


Hello everybody!
I have a problem: when the transition is running I close the application and it crash on the line CCNode::189

  CCASSERT(!_running, "Node still marked as running on node destruction! Was base class onExit() called in derived class onExit() implementations?");

Source code:

#include "SplashScene.h"
#include "GameScene.h"


Scene* SplashScene::createScene(NextScene_t nextScene)
    auto scene = Scene::create();
	auto layer = SplashScene::create();
    return scene;

bool SplashScene::init()
    if ( !Layer::init() )
        return false;
    Size visibleSize = Director::getInstance()->getVisibleSize();
    Vec2 origin = Director::getInstance()->getVisibleOrigin();    
	auto logo = Sprite::create("Logo.png");
	logo->setPosition(Point(visibleSize.width / 2 + origin.x, visibleSize.height / 2 + origin.y));	
	scheduleOnce(schedule_selector(SplashScene::createNexteScene), 1);

    return true;

void SplashScene::createNexteScene(float dt)
	Scene* scene = nullptr;
	switch (_nextScene)
	case SplashScene::GAME_SCENE:
		scene = GameScene::createScene();
		Director::getInstance()->replaceScene(TransitionFade::create(0.5, scene));
	case SplashScene::MENU_SCENE:

Can anybody help me?


Do you have any derived class which override the onExit method but forget to call the base version of onExit?

You problem might be it.


No, I don’t override the onExit method in any classes.
It looks like bug in cocos2d-x v3. I created a simple application, copied and pasted HelloWorldScene, renamed the class from HelloWorld to Temp and wrote

void HelloWorld::menuCloseCallback(Ref* pSender)
	auto scene = Temp::createScene();
	Director::getInstance()->replaceScene(TransitionFade::create(1, scene));

App crashes when I close it while transition is running.


when you say your app is crashed… please explain in detail what happened…

or best… just save your logcat to a text file… and put it in here…
so that we can review… where exactly the crash occoured… :smile:

Happy Coding. :smile:


When app crashes - it crashes

on the line CCNode::189

I attach log and source code (zip).

Ready for GLSL
Ready for OpenGL 2.0

	gl.version: 4.2.0 - Build
	gl.supports_NPOT: true
	cocos2d.x.version: cocos2d-x 3.2
	cocos2d.x.compiled_with_profiler: false
	cocos2d.x.build_type: DEBUG
	cocos2d.x.compiled_with_gl_state_cache: true
	gl.max_texture_size: 16384
	gl.vendor: Intel
	gl.renderer: Intel(R) HD Graphics 4600
	gl.max_texture_units: 96
	gl.supports_ETC1: false
	gl.supports_S3TC: true
	gl.supports_ATITC: false
	gl.supports_PVRTC: false
	gl.supports_BGRA8888: false
	gl.supports_discard_framebuffer: false
	gl.supports_vertex_array_object: true

Assert failed: Node still marked as running on node destruction! Was base class onExit() called in derived class onExit() implementations?
Assertion failed!

Program: ...s2dx\projects\Temp\proj.win32\Debug.win32\Temp.exe
File: CCNode.cpp
Line: 189

Expression: !_running

For information on how your program can cause an assertion
failure, see the Visual C++ documentation on asserts (4.4 KB)


I have tested your code with the v3.3 on my MacbookPro, it’s OK.
What’s the engine version do you use?


I use cocos2d-x v3.2 on Windows 8.1 Proffesional with MS Visual Studio 2013.
I have recorded video with crash application. (Sorry for *.wmv in *.zip - I don’t know the best way to attach the video).
cocos2d-x v3 (493.4 KB)

On the video I run the app => press button => start replace scene with Transition => close the app => see the crash.


I have same similar problem.

I made a class that inherits from TableViewCell. I added my custom cell to a table which is in a scene. When I call replaceScene I get same error. It only happens on iOS 7.1. It doesn’t happen on iOS 8 either on android devices.

I use cocos2d-x 3.3.


Yeah, I met this too.

Cocos2d-x 3.3 with lua.

Just called a “replaceScene”, and it said “Node still marked as running on node destruction! Was base class onExit() called in derived class onExit() implementations?”

I didn’t do any “onEnter” nor “onExit”


I had this same problem also using cocos2dx 3.3, does the cocos2dx team have solution for this?


Same thing on Win32 (v3.4). Run cpp-test go to transition menu, click on next transition and try closing application while transitioning scene (ALT+F4 or clicking on ‘x’) => crash.


I got this now. I am moving a game made in cocos2d-x 3.5 to 3.6… and just like that the problem appeared. I have seen this before, afair, but it was never a problem. I’m not sure what changed, except 3.5->3.6.

I do not override onExit in any class. I do override onExitTransitionDidStart, but I always and double-checked that super class implementation is called. And, this problem did not appear like this on 3.5…

I would like to know if there’s a way to know WHAT node was not properly removed… this is not in the debug log.

Right now I’m using RapidGame so I can’t easily dig into cocos2d-x code :stuck_out_tongue:

I’m getting this problem with any Director::getInstance()->replaceScene(scene) call.


I seem to have find a cure for my problems. As I use RapidGame, I looked to the template game project of RapidGame to see how transitions are performed there. Turns out the structure of scenes are quite different from what I’ve been used until now in cocos2d-x.

Instead of subclassing Layer for a scene, the template subclasses Scene. No use of init(), createScene() etc. Just use new Mysceneclass when instantiating a scene. I don’t know where this kind of code came from because it does not look like it’s made its way into the sample HelloCpp in cocos2d-x 3.6 yet. Things are a bit confusing… but it looks like I fixed this issue for now.


Ok I’m back with this… because using new Myscene seems to likely cause memory leaks, because the scenes replaced when using replaceScene() aren’t ever deleted, obviously, because in C++ that would be the responsibility of the caller of new… or so my thinking goes. So I am reverting the code to use createScene, but that brings back the crashing when going to next scene. Doh…


I’m also dealing with this issue, has anyone figured out a solution? Mine is Director::popScene().


This seems to still be an issue in 3.10.
Quitting the app while replacing scene using a transition makes a base call to


which attempts to release scenes that are being transitioned between resulting in the assertion of

Node still marked as running on node destruction! Was base class onExit() called in derived class onExit() implementations?


The reason is you replaced the scene even before your first scene is finished creating. Example !

You have 3 scene : A , B , C.

At scene A , you call :

At scene B, you call :

For some reason , Scene B quickly call scene C -> The Scene B promptly uninitialized -> crash !


I confirm that this still happens with cocos 3.17 beta (from github).


i am having same problem… did you get the solution :slight_smile:


yes, some codes was wrong , so you need to 2xcheck codes in scenes. Or you can add loading scene , when you want to change scene.