Handle reconfigure duplicated reference holding for goe charger
This commit is contained in:
parent
2716e54451
commit
b9221ee746
@ -112,6 +112,10 @@ void IntegrationPluginGoECharger::setupThing(ThingSetupInfo *info)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Handle reconfigure
|
||||||
|
if (m_monitors.contains(thing))
|
||||||
|
hardwareManager()->networkDeviceDiscovery()->unregisterMonitor(m_monitors.take(thing));
|
||||||
|
|
||||||
// Create the monitor
|
// Create the monitor
|
||||||
NetworkDeviceMonitor *monitor = hardwareManager()->networkDeviceDiscovery()->registerMonitor(macAddress);
|
NetworkDeviceMonitor *monitor = hardwareManager()->networkDeviceDiscovery()->registerMonitor(macAddress);
|
||||||
m_monitors.insert(thing, monitor);
|
m_monitors.insert(thing, monitor);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user