summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/corelib/kernel/qobject.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/corelib/kernel/qobject.cpp b/src/corelib/kernel/qobject.cpp
index 0a3db0cd06..20c634ad78 100644
--- a/src/corelib/kernel/qobject.cpp
+++ b/src/corelib/kernel/qobject.cpp
@@ -4293,6 +4293,10 @@ bool QObject::disconnect(const QMetaObject::Connection &connection)
if (c->next)
c->next->prev = c->prev;
c->receiver = 0;
+
+ const_cast<QMetaObject::Connection &>(connection).d_ptr = 0;
+ c->deref(); // has been removed from the QMetaObject::Connection object
+
// disconnectNotify() not called (the signal index is unknown).
return true;