Merge pull request #8696 from howard-stearns/check-timers-during-shutdown

fix crash in scripted timer on shutdown
This commit is contained in:
Howard Stearns 2016-10-01 10:00:49 -07:00 committed by GitHub
commit 4c5bf3119e

View file

@ -1017,9 +1017,12 @@ void ScriptEngine::updateMemoryCost(const qint64& deltaSize) {
}
void ScriptEngine::timerFired() {
if (DependencyManager::get<ScriptEngines>()->isStopped()) {
qCDebug(scriptengine) << "Script.timerFired() while shutting down is ignored... parent script:" << getFilename();
return; // bail early
{
auto engine = DependencyManager::get<ScriptEngines>();
if (!engine || engine->isStopped()) {
qCDebug(scriptengine) << "Script.timerFired() while shutting down is ignored... parent script:" << getFilename();
return; // bail early
}
}
QTimer* callingTimer = reinterpret_cast<QTimer*>(sender());