diff options
author | Frederik Gladhorn <frederik.gladhorn@digia.com> | 2014-02-12 16:28:07 +0100 |
---|---|---|
committer | Frederik Gladhorn <frederik.gladhorn@digia.com> | 2014-02-12 16:28:07 +0100 |
commit | a9c88c1f39c41215eb9d7288a1fd02aa865e8a04 (patch) | |
tree | d6229a2370f202d5ff8a5f56da1f43982bc524c2 /src/corelib/kernel | |
parent | ff23fb6cf723bcc52a5f037ef92500c480ce5a5c (diff) | |
parent | 8e22d71b225576ae7ccd6ed349c05219bae7689e (diff) |
Merge remote-tracking branch 'origin/stable' into dev
Conflicts:
src/gui/image/qimage.cpp
src/gui/text/qtextengine.cpp
src/plugins/platforms/linuxfb/qlinuxfbscreen.cpp
src/printsupport/kernel/qprintengine_win.cpp
Change-Id: I09ce991a57f39bc7b1ad6978d0e0d858df0cd444
Diffstat (limited to 'src/corelib/kernel')
-rw-r--r-- | src/corelib/kernel/qobject.cpp | 8 |
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. |