mirror of
https://github.com/overte-org/overte.git
synced 2025-08-08 12:37:51 +02:00
Merge pull request #8696 from howard-stearns/check-timers-during-shutdown
fix crash in scripted timer on shutdown
This commit is contained in:
commit
4c5bf3119e
1 changed files with 6 additions and 3 deletions
|
@ -1017,10 +1017,13 @@ void ScriptEngine::updateMemoryCost(const qint64& deltaSize) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void ScriptEngine::timerFired() {
|
void ScriptEngine::timerFired() {
|
||||||
if (DependencyManager::get<ScriptEngines>()->isStopped()) {
|
{
|
||||||
|
auto engine = DependencyManager::get<ScriptEngines>();
|
||||||
|
if (!engine || engine->isStopped()) {
|
||||||
qCDebug(scriptengine) << "Script.timerFired() while shutting down is ignored... parent script:" << getFilename();
|
qCDebug(scriptengine) << "Script.timerFired() while shutting down is ignored... parent script:" << getFilename();
|
||||||
return; // bail early
|
return; // bail early
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
QTimer* callingTimer = reinterpret_cast<QTimer*>(sender());
|
QTimer* callingTimer = reinterpret_cast<QTimer*>(sender());
|
||||||
CallbackData timerData = _timerFunctionMap.value(callingTimer);
|
CallbackData timerData = _timerFunctionMap.value(callingTimer);
|
||||||
|
|
Loading…
Reference in a new issue