From 5ac97a38e840da4dad0d5b0e1acbf2ecb46ecf74 Mon Sep 17 00:00:00 2001 From: Giuseppe D'Angelo Date: Wed, 13 Sep 2023 10:34:30 +0200 Subject: [PATCH] QObject: do not copy a ConnectionList object The semantics of copying a ConnectionList are not defined; the type is copiable by accident. Use a reference to the list instead (like done in other places in the code). Change-Id: Ifbc5d3baca992f3eb13e3781378e79ed1feb4e1c Reviewed-by: Thiago Macieira --- src/corelib/kernel/qobject.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/corelib/kernel/qobject.cpp b/src/corelib/kernel/qobject.cpp index b7474321d3b..e5e1b7a7d12 100644 --- a/src/corelib/kernel/qobject.cpp +++ b/src/corelib/kernel/qobject.cpp @@ -5455,7 +5455,7 @@ QObjectPrivate::getPropertyAdaptorSlotObject(const QMetaProperty &property) int signal_index = methodIndexToSignalIndex(&metaObject, property.notifySignalIndex()); if (signal_index >= conns->signalVectorCount()) return nullptr; - const auto connectionList = conns->connectionsForSignal(signal_index); + const auto &connectionList = conns->connectionsForSignal(signal_index); for (auto c = connectionList.first.loadRelaxed(); c; c = c->nextConnectionList.loadRelaxed()) { if (c->isSlotObject) {