summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenis Shienkov <denis.shienkov@gmail.com>2016-05-03 17:05:50 +0300
committerDenis Shienkov <denis.shienkov@gmail.com>2016-05-04 12:09:27 +0000
commit8a30a60a03af3979de8988209f8f77638713c30d (patch)
tree46ad4e97bb919e801bf1579cfe8eb979ff6c897c
parent7d0d53c6a390dfbdb803ea635ef61e80588063a8 (diff)
downloadqtserialport-8a30a60a03af3979de8988209f8f77638713c30d.tar.gz
Remove superfluous check during removal of the pointer
... as deleting of a null-pointer it is a valid operation. Change-Id: Ia4ffd8b69ab75b9e3b200ce2ce999ab2820b915e Reviewed-by: Frank Meerkoetter <frank.meerkoetter@basyskom.com> Reviewed-by: André Hartmann <aha_1980@gmx.de>
-rw-r--r--src/serialport/qserialport_unix.cpp12
-rw-r--r--src/serialport/qserialport_win.cpp12
2 files changed, 8 insertions, 16 deletions
diff --git a/src/serialport/qserialport_unix.cpp b/src/serialport/qserialport_unix.cpp
index 7153449..7662a90 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 e356e4c..1680d5a 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;