fix a crash on removal

This commit is contained in:
Michael Zanetti 2022-04-06 13:43:56 +02:00
parent 5d20d4759f
commit b1de77c63d

View File

@ -208,7 +208,7 @@ void IntegrationPluginSchrack::postSetupThing(Thing *thing)
// We'll not actually evaluate the actual results in here because // We'll not actually evaluate the actual results in here because
// this piece of code should be replaced with the modbus tool internal connected detection when it's ready // this piece of code should be replaced with the modbus tool internal connected detection when it's ready
ModbusRtuReply *reply = connection->readCpSignalState(); ModbusRtuReply *reply = connection->readCpSignalState();
connect(reply, &ModbusRtuReply::finished, [reply, thing](){ connect(reply, &ModbusRtuReply::finished, thing, [reply, thing](){
qCDebug(dcSchrack) << "CP signal state reply finished" << reply->error(); qCDebug(dcSchrack) << "CP signal state reply finished" << reply->error();
thing->setStateValue(cionConnectedStateTypeId, reply->error() == ModbusRtuReply::NoError); thing->setStateValue(cionConnectedStateTypeId, reply->error() == ModbusRtuReply::NoError);
}); });