summaryrefslogtreecommitdiffstats
path: root/src/corelib
diff options
context:
space:
mode:
authorFlorian Vichot <florian.vichot@gmail.com>2009-10-09 14:53:50 (GMT)
committerOlivier Goffart <ogoffart@trolltech.com>2009-10-13 08:20:49 (GMT)
commit2d2e422107a93a2a84ba74399678496619329e58 (patch)
treeecf081d73d39d9cd0dea724b85c7ea385eec8b1d /src/corelib
parent6201e4adda316e5a582af687cdd2f1bcd19be31d (diff)
downloadQt-2d2e422107a93a2a84ba74399678496619329e58.zip
Qt-2d2e422107a93a2a84ba74399678496619329e58.tar.gz
Qt-2d2e422107a93a2a84ba74399678496619329e58.tar.bz2
QMetaObject::activate: reordered mutex locks/unlocks around spy
Always call the callbacks unlocked to avoid deadlocks. (The others call to the callback ar unlocked) Reviewed-by: Olivier Goffart Merge-request: 1744
Diffstat (limited to 'src/corelib')
-rw-r--r--src/corelib/kernel/qobject.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/corelib/kernel/qobject.cpp b/src/corelib/kernel/qobject.cpp
index a8120cf..7be19b3 100644
--- a/src/corelib/kernel/qobject.cpp
+++ b/src/corelib/kernel/qobject.cpp
@@ -3332,6 +3332,7 @@ void QMetaObject::activate(QObject *sender, const QMetaObject *m, int local_sign
QObjectConnectionListVector *connectionLists = sender->d_func()->connectionLists;
if (!connectionLists) {
+ locker.unlock();
if (qt_signal_spy_callback_set.signal_end_callback != 0)
qt_signal_spy_callback_set.signal_end_callback(sender, signal_absolute_index);
return;
@@ -3401,11 +3402,11 @@ void QMetaObject::activate(QObject *sender, const QMetaObject *m, int local_sign
}
#endif
- locker.relock();
-
if (qt_signal_spy_callback_set.slot_end_callback != 0)
qt_signal_spy_callback_set.slot_end_callback(receiver, method);
+ locker.relock();
+
QObjectPrivate::resetCurrentSender(receiver, &currentSender, previousSender);
if (connectionLists->orphaned)