| 879 | } |
| 880 | |
| 881 | void Director::popScene() |
| 882 | { |
| 883 | AXASSERT(_runningScene != nullptr, "running scene should not null"); |
| 884 | |
| 885 | #if AX_ENABLE_GC_FOR_NATIVE_OBJECTS |
| 886 | auto sEngine = ScriptEngineManager::getInstance()->getScriptEngine(); |
| 887 | if (sEngine) |
| 888 | { |
| 889 | sEngine->releaseScriptObject(this, _scenesStack.back()); |
| 890 | } |
| 891 | #endif // AX_ENABLE_GC_FOR_NATIVE_OBJECTS |
| 892 | _scenesStack.popBack(); |
| 893 | ssize_t c = _scenesStack.size(); |
| 894 | |
| 895 | if (c == 0) |
| 896 | { |
| 897 | end(); |
| 898 | } |
| 899 | else |
| 900 | { |
| 901 | _sendCleanupToScene = true; |
| 902 | _nextScene = _scenesStack.at(c - 1); |
| 903 | } |
| 904 | } |
| 905 | |
| 906 | void Director::popToRootScene() |
| 907 | { |