fix a crash when a device is remove which never registered a timer
This commit is contained in:
parent
dea50f46c2
commit
0b05a72d46
@ -62,9 +62,12 @@ DeviceManager::DeviceSetupStatus DevicePluginSimulation::setupDevice(Device *dev
|
|||||||
|
|
||||||
void DevicePluginSimulation::deviceRemoved(Device *device)
|
void DevicePluginSimulation::deviceRemoved(Device *device)
|
||||||
{
|
{
|
||||||
|
// Clean up any timers we may have for this device
|
||||||
|
if (m_simulationTimers.contains(device)) {
|
||||||
QTimer *t = m_simulationTimers.take(device);
|
QTimer *t = m_simulationTimers.take(device);
|
||||||
t->stop();
|
t->stop();
|
||||||
t->deleteLater();
|
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