Showing the changes to libraries/script-engine/src/ScriptEngine.cpp (1 of 1 file). Show all
Unified · Split
| @@ -1017,9 +1017,12 @@ void ScriptEngine::updateMemoryCost(const qint64& deltaSize) { · 1016 unmodified lines | ||
| 1017 | 1017 | } |
| 1018 | 1018 | |
| 1019 | 1019 | void ScriptEngine::timerFired() { |
| 1020 | − if (DependencyManager::get<ScriptEngines>()->isStopped()) { | |
| 1021 | − qCDebug(scriptengine) << "Script.timerFired() while shutting down is ignored... parent script:" << getFilename(); | |
| 1022 | − return; // bail early | |
| 1020 | + { | |
| 1021 | + auto engine = DependencyManager::get<ScriptEngines>(); | |
| 1022 | + if (!engine || engine->isStopped()) { | |
| 1023 | + qCDebug(scriptengine) << "Script.timerFired() while shutting down is ignored... parent script:" << getFilename(); | |
| 1024 | + return; // bail early | |
| 1025 | + } | |
| 1023 | 1026 | } |
| 1024 | 1027 | |
| 1025 | 1028 | QTimer* callingTimer = reinterpret_cast<QTimer*>(sender()); |