Make sure the setup thing for nuki gets cleaned up everywhere

master
Simon Stürz 2021-03-22 11:28:37 +01:00
parent 971ec9a75c
commit 72b99e0415
1 changed files with 8 additions and 1 deletions

View File

@ -200,7 +200,14 @@ void IntegrationPluginNuki::confirmPairing(ThingPairingInfo *info, const QString
m_pairingInfo = info;
m_asyncSetupNuki->startAuthenticationProcess(info->transactionId());
connect(info, &ThingPairingInfo::destroyed, this, [this] { m_pairingInfo = nullptr; });
connect(info, &ThingPairingInfo::destroyed, this, [this] {
m_pairingInfo = nullptr;
if (m_asyncSetupNuki) {
qCDebug(dcNuki()) << "Deleting the temporary pairing device";
m_asyncSetupNuki->deleteLater();
m_asyncSetupNuki = nullptr;
}
});
}
void IntegrationPluginNuki::postSetupThing(Thing *thing)