fixed memory leak on reconfigure
This commit is contained in:
parent
465dcf9b29
commit
3d8c9bdd56
@ -112,9 +112,16 @@ void IntegrationPluginTado::setupThing(ThingSetupInfo *info)
|
|||||||
|
|
||||||
if (thing->thingClassId() == tadoAccountThingClassId) {
|
if (thing->thingClassId() == tadoAccountThingClassId) {
|
||||||
|
|
||||||
qCDebug(dcTado) << "Setup tado connection" << thing->name() << thing->params();
|
qCDebug(dcTado) << "Setup Tado account" << thing->name() << thing->params();
|
||||||
Tado *tado;
|
Tado *tado;
|
||||||
|
|
||||||
|
if (m_tadoAccounts.contains(thing->id())) {
|
||||||
|
qCDebug(dcTado()) << "Setup after reconfigure, cleaning up";
|
||||||
|
m_tadoAccounts.take(thing->id())->deleteLater();
|
||||||
|
}
|
||||||
|
|
||||||
if (m_unfinishedTadoAccounts.contains(thing->id())) {
|
if (m_unfinishedTadoAccounts.contains(thing->id())) {
|
||||||
|
qCDebug(dcTado()) << "Using Tado connection from pairing process";
|
||||||
tado = m_unfinishedTadoAccounts.take(thing->id());
|
tado = m_unfinishedTadoAccounts.take(thing->id());
|
||||||
m_tadoAccounts.insert(thing->id(), tado);
|
m_tadoAccounts.insert(thing->id(), tado);
|
||||||
info->finish(Thing::ThingErrorNoError);
|
info->finish(Thing::ThingErrorNoError);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user