mirror of
https://github.com/nymea/nymea-plugins.git
synced 2026-10-22 14:33:25 +02:00
fix a crash when a device is remove which never registered a timer
This commit is contained in:
parent
3c1d409201
commit
35bc7d321f
@ -62,9 +62,12 @@ DeviceManager::DeviceSetupStatus DevicePluginSimulation::setupDevice(Device *dev
|
|||||||
|
|
||||||
void DevicePluginSimulation::deviceRemoved(Device *device)
|
void DevicePluginSimulation::deviceRemoved(Device *device)
|
||||||
{
|
{
|
||||||
QTimer *t = m_simulationTimers.take(device);
|
// Clean up any timers we may have for this device
|
||||||
t->stop();
|
if (m_simulationTimers.contains(device)) {
|
||||||
t->deleteLater();
|
QTimer *t = m_simulationTimers.take(device);
|
||||||
|
t->stop();
|
||||||
|
t->deleteLater();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
DeviceManager::DeviceError DevicePluginSimulation::executeAction(Device *device, const Action &action)
|
DeviceManager::DeviceError DevicePluginSimulation::executeAction(Device *device, const Action &action)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user