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 <thiago.macieira@intel.com>
This commit is contained in:
Giuseppe D'Angelo 2023-09-13 10:34:30 +02:00
parent e49d8444dc
commit 5ac97a38e8

View File

@ -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) {