summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenis Shienkov <denis.shienkov@gmail.com>2015-08-06 18:01:38 +0300
committerDenis Shienkov <denis.shienkov@gmail.com>2015-08-06 15:50:52 +0000
commitc0aebf3dfe3c6837db8f91d65ac4b6b7b44e100e (patch)
treeabdf8691d25e0ca1f2c4f80da7ff2f8c2d294deb
parent1d753e0b3a6aca6e506760962e500a0a701d378d (diff)
downloadqtserialport-c0aebf3dfe3c6837db8f91d65ac4b6b7b44e100e.tar.gz
Delete the startAsyncWriteTimer object on close
There are no sense to keep the startAsyncWriteTimer object when the device is closed. Because in next time the device can be opened in read-only mode, and the startAsyncWriteTimer will never used. Change-Id: I315ddfa88517087dcf708b0057a0e7c27cb1a3f1 Reviewed-by: Sergey Belyashov <Sergey.Belyashov@gmail.com> Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
-rw-r--r--src/serialport/qserialport_win.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/serialport/qserialport_win.cpp b/src/serialport/qserialport_win.cpp
index a5386c7..a9687a2 100644
--- a/src/serialport/qserialport_win.cpp
+++ b/src/serialport/qserialport_win.cpp
@@ -112,6 +112,11 @@ void QSerialPortPrivate::close()
notifier = Q_NULLPTR;
}
+ if (startAsyncWriteTimer) {
+ delete startAsyncWriteTimer;
+ startAsyncWriteTimer = Q_NULLPTR;
+ }
+
readStarted = false;
writeStarted = false;
writeBuffer.clear();