summaryrefslogtreecommitdiff
path: root/src/script/bridge/qscriptqobject.cpp
diff options
context:
space:
mode:
authorKent Hansen <kent.hansen@nokia.com>2012-06-25 15:46:36 +0200
committerQt by Nokia <qt-info@nokia.com>2012-06-26 13:58:12 +0200
commitc89315da2e836fe67c4228cfb73c25a68b0a3a95 (patch)
treefa1f5a143273e8d30728ed69887e0ce3134a2949 /src/script/bridge/qscriptqobject.cpp
parent4e95f21a77cb77cecda50865b3ce75104d7729b5 (diff)
downloadqtscript-c89315da2e836fe67c4228cfb73c25a68b0a3a95.tar.gz
Don't crash if queued signal handler no longer exists
Task-number: QTBUG-26261 Change-Id: Ie269c56c0336b1c937d4ec551f913ae7537d0338 Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Diffstat (limited to 'src/script/bridge/qscriptqobject.cpp')
-rw-r--r--src/script/bridge/qscriptqobject.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/script/bridge/qscriptqobject.cpp b/src/script/bridge/qscriptqobject.cpp
index 962479f..807c94c 100644
--- a/src/script/bridge/qscriptqobject.cpp
+++ b/src/script/bridge/qscriptqobject.cpp
@@ -2092,7 +2092,13 @@ void QObjectConnectionManager::execute(int slotIndex, void **argv)
}
}
}
- Q_ASSERT(slot && slot.isObject());
+ if (!slot) {
+ // This connection no longer exists (can happen if the signal is
+ // emitted from another thread and the call gets queued, but the
+ // connection is removed before the QMetaCallEvent gets processed).
+ return;
+ }
+ Q_ASSERT(slot.isObject());
if (engine->isCollecting()) {
qWarning("QtScript: can't execute signal handler during GC");