summaryrefslogtreecommitdiffstats
path: root/src/corelib/kernel
diff options
context:
space:
mode:
authorKonstantin Ritt <ritt.ks@gmail.com>2014-02-13 09:35:08 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-02-13 09:35:08 +0100
commit7ac97d7efb1a1e75633ce31fbb03eb43a9b01670 (patch)
tree4284e5eff68c13cc52be1c658d6c2abffee3ece5 /src/corelib/kernel
parent5b14bf342f43bd6cb02ad751db8da851850814bb (diff)
parenta9c88c1f39c41215eb9d7288a1fd02aa865e8a04 (diff)
Merge "Merge remote-tracking branch 'origin/stable' into dev" into refs/staging/dev
Diffstat (limited to 'src/corelib/kernel')
-rw-r--r--src/corelib/kernel/qobject.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/corelib/kernel/qobject.cpp b/src/corelib/kernel/qobject.cpp
index 876ed8f27b..262d259136 100644
--- a/src/corelib/kernel/qobject.cpp
+++ b/src/corelib/kernel/qobject.cpp
@@ -3663,9 +3663,15 @@ void QMetaObject::activate(QObject *sender, int signalOffset, int local_signal_i
const int method_relative = c->method_relative;
if (c->isSlotObject) {
c->slotObj->ref();
- const QScopedPointer<QtPrivate::QSlotObjectBase, QSlotObjectBaseDeleter> obj(c->slotObj);
+ QScopedPointer<QtPrivate::QSlotObjectBase, QSlotObjectBaseDeleter> obj(c->slotObj);
locker.unlock();
obj->call(receiver, argv ? argv : empty_argv);
+
+ // Make sure the slot object gets destroyed before the mutex is locked again, as the
+ // destructor of the slot object might also lock a mutex from the signalSlotLock() mutex pool,
+ // and that would deadlock if the pool happens to return the same mutex.
+ obj.reset();
+
locker.relock();
} else if (callFunction && c->method_offset <= receiver->metaObject()->methodOffset()) {
//we compare the vtable to make sure we are not in the destructor of the object.