Showing the changes to libraries/script-engine/src/ScriptManager.cpp (1 of 2 files). Show all
Unified · Split
| @@ -550,6 +550,8 @@ void ScriptManager::waitTillDoneRunning(bool shutdown) { · 549 unmodified lines | ||
| 550 | 550 | // if they access Settings or Menu in any of their shutdown code. So: |
| 551 | 551 | // Process events for this thread, allowing invokeMethod calls to pass between threads. |
| 552 | 552 | QCoreApplication::processEvents(); |
| 553 | + // Events may use script engine so guard is necessary. | |
| 554 | + auto scopeGuard = _engine->getScopeGuard(); | |
| 553 | 555 | _engine->processEvents(); |
| 554 | 556 | } |
| 555 | 557 | |
| @@ -1224,6 +1226,11 @@ void ScriptManager::timerFired() { · 668 unmodified lines | ||
| 1224 | 1226 | return; // bail early |
| 1225 | 1227 | } |
| 1226 | 1228 | |
| 1229 | + // Timer events shouldn't be processed after the script engine has shut down. | |
| 1230 | + if (_isDoneRunning) { | |
| 1231 | + return; | |
| 1232 | + } | |
| 1233 | + | |
| 1227 | 1234 | //#define SCRIPT_TIMER_PERFORMANCE_STATISTICS |
| 1228 | 1235 | #ifdef SCRIPT_TIMER_PERFORMANCE_STATISTICS |
| 1229 | 1236 | _timerCallCounter++; |