Fix hang on exit from dying scripts
Showing the changes to interface/src/Application.cpp (1 of 7 files). Show all
Unified · Split
| @@ -1156,10 +1156,16 @@ void Application::cleanupBeforeQuit() { · 1155 unmodified lines | ||
| 1156 | 1156 | |
| 1157 | 1157 | getEntities()->shutdown(); // tell the entities system we're shutting down, so it will stop running scripts |
| 1158 | 1158 | |
| 1159 | + // Clear any queued processing (I/O, FBX/OBJ/Texture parsing) | |
| 1160 | + QThreadPool::globalInstance()->clear(); | |
| 1161 | + | |
| 1159 | 1162 | DependencyManager::get<ScriptEngines>()->saveScripts(); |
| 1160 | 1163 | DependencyManager::get<ScriptEngines>()->shutdownScripting(); // stop all currently running global scripts |
| 1161 | 1164 | DependencyManager::destroy<ScriptEngines>(); |
| 1162 | 1165 | |
| 1166 | + // Cleanup all overlays after the scripts, as scripts might add more | |
| 1167 | + _overlays.cleanupAllOverlays(); | |
| 1168 | + | |
| 1163 | 1169 | // first stop all timers directly or by invokeMethod |
| 1164 | 1170 | // depending on what thread they run in |
| 1165 | 1171 | locationUpdateTimer.stop(); |