History

better shutdown check for timer firings

howard-stearns committed 10 years ago

Commit c806f6c1 parent 41e90ed1 file · +6 −3Browse files

Showing the changes to libraries/script-engine/src/ScriptEngine.cpp (1 of 1 file). Show all

Unified · Split

libraries/script-engine/src/ScriptEngine.cpp+6−3
@@ -1017,9 +1017,12 @@ void ScriptEngine::updateMemoryCost(const qint64& deltaSize) { · 1016 unmodified lines
1017}1017}
1018 1018
1019void ScriptEngine::timerFired() {1019void ScriptEngine::timerFired() {
1020 if (DependencyManager::get<ScriptEngines>()->isStopped()) {1020 {
1021 qCDebug(scriptengine) << "Script.timerFired() while shutting down is ignored... parent script:" << getFilename();1021 auto engine = DependencyManager::get<ScriptEngines>();
1022 return; // bail early1022 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 QTimer* callingTimer = reinterpret_cast<QTimer*>(sender());1028 QTimer* callingTimer = reinterpret_cast<QTimer*>(sender());