fixed event connection

This commit is contained in:
Bernhard Trinnes 2018-06-13 23:58:19 +02:00 committed by Michael Zanetti
parent dbe1d2e10c
commit 66494c74f7
2 changed files with 2 additions and 4 deletions

View File

@ -197,7 +197,6 @@ void DevicePluginSerialPortCommander::deviceRemoved(Device *device)
serialPortCommander->removeInputDevice(device); serialPortCommander->removeInputDevice(device);
if (serialPortCommander->isEmpty()) { if (serialPortCommander->isEmpty()) {
m_serialPortCommanders.remove(interface); m_serialPortCommanders.remove(interface);
serialPortCommander->serialPort()->close();
serialPortCommander->deleteLater(); serialPortCommander->deleteLater();
} }
} }
@ -208,7 +207,6 @@ void DevicePluginSerialPortCommander::deviceRemoved(Device *device)
serialPortCommander->removeOutputDevice(); serialPortCommander->removeOutputDevice();
if (serialPortCommander->isEmpty()) { if (serialPortCommander->isEmpty()) {
m_serialPortCommanders.remove(interface); m_serialPortCommanders.remove(interface);
serialPortCommander->serialPort()->close();
serialPortCommander->deleteLater(); serialPortCommander->deleteLater();
} }
} }

View File

@ -45,7 +45,7 @@ void SerialPortCommander::addOutputDevice(Device* device)
void SerialPortCommander::removeOutputDevice() void SerialPortCommander::removeOutputDevice()
{ {
m_outputDevice = NULL; m_outputDevice = nullptr;
} }
@ -63,7 +63,7 @@ void SerialPortCommander::removeInputDevice(Device* device)
bool SerialPortCommander::isEmpty() bool SerialPortCommander::isEmpty()
{ {
return(!hasOutputDevice() || m_inputDevices.empty()); return(!hasOutputDevice() && m_inputDevices.empty());
} }