diff --git a/cocos/base/CCDirector.cpp b/cocos/base/CCDirector.cpp index fdb9ccffe8..c8788d2eea 100644 --- a/cocos/base/CCDirector.cpp +++ b/cocos/base/CCDirector.cpp @@ -937,16 +937,7 @@ void Director::restart() } void Director::reset() -{ - // cleanup scheduler - getScheduler()->unscheduleAll(); - - // Remove all events - if (_eventDispatcher) - { - _eventDispatcher->removeAllEventListeners(); - } - +{ if (_runningScene) { _runningScene->onExit(); @@ -956,6 +947,15 @@ void Director::reset() _runningScene = nullptr; _nextScene = nullptr; + + // cleanup scheduler + getScheduler()->unscheduleAll(); + + // Remove all events + if (_eventDispatcher) + { + _eventDispatcher->removeAllEventListeners(); + } // remove all objects, but don't release it. // runWithScene might be executed after 'end'.