Explicitly stop the ZCL timeout timer

Also don't use a QueuedConnection, as it's not guaranteed the
sender will still live on by the time slot is called.
This commit is contained in:
Michael Zanetti 2022-05-12 17:33:35 +02:00
parent 62e003887e
commit fd12d0518b
2 changed files with 3 additions and 2 deletions

View File

@ -208,7 +208,7 @@ ZigbeeClusterReply *ZigbeeCluster::createClusterReply(const ZigbeeNetworkRequest
connect(zclReply, &ZigbeeClusterReply::finished, this, [this, zclReply](){ connect(zclReply, &ZigbeeClusterReply::finished, this, [this, zclReply](){
zclReply->deleteLater(); zclReply->deleteLater();
m_pendingReplies.remove(zclReply->transactionSequenceNumber()); m_pendingReplies.remove(zclReply->transactionSequenceNumber());
}, Qt::QueuedConnection); });
return zclReply; return zclReply;
} }
@ -412,6 +412,7 @@ void ZigbeeCluster::finishZclReply(ZigbeeClusterReply *zclReply)
{ {
qCDebug(dcZigbeeCluster()) << "ZigbeeClusterReply finished" << zclReply->request() << zclReply->requestFrame() << zclReply->responseFrame(); qCDebug(dcZigbeeCluster()) << "ZigbeeClusterReply finished" << zclReply->request() << zclReply->requestFrame() << zclReply->responseFrame();
// FIXME: Set the status // FIXME: Set the status
zclReply->m_timeoutTimer.stop();
emit zclReply->finished(); emit zclReply->finished();
} }

View File

@ -661,7 +661,7 @@ ZigbeeDeviceObjectReply *ZigbeeDeviceObject::createZigbeeDeviceObjectReply(const
if (zdoReply->error() != ZigbeeDeviceObjectReply::ErrorNoError) { if (zdoReply->error() != ZigbeeDeviceObjectReply::ErrorNoError) {
qCWarning(dcZigbeeDeviceObject()) << "ZDO request error for TSN:" << transactionSequenceNumber; qCWarning(dcZigbeeDeviceObject()) << "ZDO request error for TSN:" << transactionSequenceNumber;
} }
}, Qt::QueuedConnection); });
m_pendingReplies.insert(transactionSequenceNumber, zdoReply); m_pendingReplies.insert(transactionSequenceNumber, zdoReply);
return zdoReply; return zdoReply;
} }