diff options
-rw-r--r-- | src/serialport/qserialport_unix.cpp | 12 | ||||
-rw-r--r-- | src/serialport/qserialport_win.cpp | 12 |
2 files changed, 8 insertions, 16 deletions
diff --git a/src/serialport/qserialport_unix.cpp b/src/serialport/qserialport_unix.cpp index 71534494..7662a90d 100644 --- a/src/serialport/qserialport_unix.cpp +++ b/src/serialport/qserialport_unix.cpp @@ -244,15 +244,11 @@ void QSerialPortPrivate::close() ::ioctl(descriptor, TIOCNXCL); #endif - if (readNotifier) { - delete readNotifier; - readNotifier = Q_NULLPTR; - } + delete readNotifier; + readNotifier = Q_NULLPTR; - if (writeNotifier) { - delete writeNotifier; - writeNotifier = Q_NULLPTR; - } + delete writeNotifier; + writeNotifier = Q_NULLPTR; qt_safe_close(descriptor); diff --git a/src/serialport/qserialport_win.cpp b/src/serialport/qserialport_win.cpp index e356e4c9..1680d5aa 100644 --- a/src/serialport/qserialport_win.cpp +++ b/src/serialport/qserialport_win.cpp @@ -106,15 +106,11 @@ void QSerialPortPrivate::close() { ::CancelIo(handle); - if (notifier) { - delete notifier; - notifier = Q_NULLPTR; - } + delete notifier; + notifier = Q_NULLPTR; - if (startAsyncWriteTimer) { - delete startAsyncWriteTimer; - startAsyncWriteTimer = Q_NULLPTR; - } + delete startAsyncWriteTimer; + startAsyncWriteTimer = Q_NULLPTR; communicationStarted = false; readStarted = false; |