summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/script/bridge/qscriptqobject.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/script/bridge/qscriptqobject.cpp b/src/script/bridge/qscriptqobject.cpp
index 3f4f6bb..db312bc 100644
--- a/src/script/bridge/qscriptqobject.cpp
+++ b/src/script/bridge/qscriptqobject.cpp
@@ -2220,7 +2220,14 @@ void QObjectConnectionManager::execute(int slotIndex, void **argv)
JSC::call(exec, slot, callType, callData, thisObject, jscArgs);
if (exec->hadException()) {
- engine->emitSignalHandlerException();
+ if (slot.inherits(&QtFunction::info) && !static_cast<QtFunction*>(JSC::asObject(slot))->qobject()) {
+ // The function threw an error because the target QObject has been deleted.
+ // The connections list is stale; remove the signal handler and ignore the exception.
+ removeSignalHandler(sender(), signalIndex, receiver, slot);
+ exec->clearException();
+ } else {
+ engine->emitSignalHandlerException();
+ }
}
}