From 66494c74f729324f5b844ff7322649c73b7dbba3 Mon Sep 17 00:00:00 2001 From: Bernhard Trinnes Date: Wed, 13 Jun 2018 23:58:19 +0200 Subject: [PATCH] fixed event connection --- serialportcommander/devicepluginserialportcommander.cpp | 2 -- serialportcommander/serialportcommander.cpp | 4 ++-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/serialportcommander/devicepluginserialportcommander.cpp b/serialportcommander/devicepluginserialportcommander.cpp index 0ddec3b2..71b832f2 100644 --- a/serialportcommander/devicepluginserialportcommander.cpp +++ b/serialportcommander/devicepluginserialportcommander.cpp @@ -197,7 +197,6 @@ void DevicePluginSerialPortCommander::deviceRemoved(Device *device) serialPortCommander->removeInputDevice(device); if (serialPortCommander->isEmpty()) { m_serialPortCommanders.remove(interface); - serialPortCommander->serialPort()->close(); serialPortCommander->deleteLater(); } } @@ -208,7 +207,6 @@ void DevicePluginSerialPortCommander::deviceRemoved(Device *device) serialPortCommander->removeOutputDevice(); if (serialPortCommander->isEmpty()) { m_serialPortCommanders.remove(interface); - serialPortCommander->serialPort()->close(); serialPortCommander->deleteLater(); } } diff --git a/serialportcommander/serialportcommander.cpp b/serialportcommander/serialportcommander.cpp index 7ebde253..6c3d4800 100644 --- a/serialportcommander/serialportcommander.cpp +++ b/serialportcommander/serialportcommander.cpp @@ -45,7 +45,7 @@ void SerialPortCommander::addOutputDevice(Device* device) void SerialPortCommander::removeOutputDevice() { - m_outputDevice = NULL; + m_outputDevice = nullptr; } @@ -63,7 +63,7 @@ void SerialPortCommander::removeInputDevice(Device* device) bool SerialPortCommander::isEmpty() { - return(!hasOutputDevice() || m_inputDevices.empty()); + return(!hasOutputDevice() && m_inputDevices.empty()); }