summaryrefslogtreecommitdiffstats
path: root/src/corelib
diff options
context:
space:
mode:
authorGiuseppe D'Angelo <giuseppe.dangelo@kdab.com>2020-08-24 11:59:14 +0200
committerGiuseppe D'Angelo <giuseppe.dangelo@kdab.com>2020-09-01 02:48:40 +0200
commitc1454d07cfc3f4cb8273fdb45b152c8942d04129 (patch)
treedfc28048f6302d6cf14b18a0f5d343c1fcc90ea9 /src/corelib
parent2c9529e158fc589c48e6b1fb61dca2133e33ac4d (diff)
Take the right lock before using a connection's receiver
When a signal/slot connection is activated, a lock on the receiver object is taken (to be sure it doesn't get destroyed). The path for blocking queued connections however took the lock on the sender by accident, fix that. Pick-to: 5.15 5.12 Change-Id: I8cd938a50eca2bf71e7bfb86768ee0c8431afdfa Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'src/corelib')
-rw-r--r--src/corelib/kernel/qobject.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/corelib/kernel/qobject.cpp b/src/corelib/kernel/qobject.cpp
index 54229a9f71..62bee3d90b 100644
--- a/src/corelib/kernel/qobject.cpp
+++ b/src/corelib/kernel/qobject.cpp
@@ -3764,7 +3764,7 @@ void doActivate(QObject *sender, int signal_index, void **argv)
}
QSemaphore semaphore;
{
- QBasicMutexLocker locker(signalSlotLock(sender));
+ QBasicMutexLocker locker(signalSlotLock(receiver));
if (!c->receiver.loadAcquire())
continue;
QMetaCallEvent *ev = c->isSlotObject ?