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
|
@ -664,6 +664,13 @@ void Director::replaceScene(Scene *scene)
|
||||||
CCASSERT(_runningScene, "Use runWithScene: instead to start the director");
|
CCASSERT(_runningScene, "Use runWithScene: instead to start the director");
|
||||||
CCASSERT(scene != nullptr, "the scene should not be null");
|
CCASSERT(scene != nullptr, "the scene should not be null");
|
||||||
|
|
||||||
|
if (_nextScene)
|
||||||
|
{
|
||||||
|
_nextScene->onExit();
|
||||||
|
_nextScene->cleanup();
|
||||||
|
_nextScene = nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
ssize_t index = _scenesStack.size();
|
ssize_t index = _scenesStack.size();
|
||||||
|
|
||||||
_sendCleanupToScene = true;
|
_sendCleanupToScene = true;
|
||||||
|
|
Loading…
Reference in New Issue