From 12bc039baa2672c98518277ea146bedec3a92ac0 Mon Sep 17 00:00:00 2001 From: Lars Knoll Date: Thu, 21 Mar 2019 13:03:21 +0100 Subject: Don't iterate over the connections without holding a lock When checking whether a slot is connected to a signal, we need to hold the signalSlotLock to be sure about the answer, or we can get crashes when a connection gets removed while doing the check. The check in activate() can handle some uncertainty as it's only a shortcut to the longer path. Fixes: QTBUG-74604 Change-Id: I3fc822455fbadc0223ef68632f5fb3df3ff3e86d Reviewed-by: Aapo Keskimolo --- src/corelib/kernel/qobject_p.h | 1 + 1 file changed, 1 insertion(+) (limited to 'src/corelib/kernel/qobject_p.h') diff --git a/src/corelib/kernel/qobject_p.h b/src/corelib/kernel/qobject_p.h index 823c7a195a..863689fddd 100644 --- a/src/corelib/kernel/qobject_p.h +++ b/src/corelib/kernel/qobject_p.h @@ -254,6 +254,7 @@ public: int signalIndex(const char *signalName, const QMetaObject **meta = nullptr) const; bool isSignalConnected(uint signalIdx, bool checkDeclarative = true) const; + bool maybeSignalConnected(uint signalIndex) const; inline bool isDeclarativeSignalConnected(uint signalIdx) const; // To allow abitrary objects to call connectNotify()/disconnectNotify() without making -- cgit v1.2.3