mirror of https://github.com/axmolengine/axmol.git
Fixed tilemaptest crashes when click 'next' button quickly
This commit is contained in:
parent
2037c2e232
commit
8038d3daa5
|
@ -663,6 +663,13 @@ void Director::replaceScene(Scene *scene)
|
|||
{
|
||||
CCASSERT(_runningScene, "Use runWithScene: instead to start the director");
|
||||
CCASSERT(scene != nullptr, "the scene should not be null");
|
||||
|
||||
if (_nextScene)
|
||||
{
|
||||
_nextScene->onExit();
|
||||
_nextScene->cleanup();
|
||||
_nextScene = nullptr;
|
||||
}
|
||||
|
||||
ssize_t index = _scenesStack.size();
|
||||
|
||||
|
|
Loading…
Reference in New Issue