diff options
author | Denis Shienkov <denis.shienkov@gmail.com> | 2016-07-07 21:37:49 +0300 |
---|---|---|
committer | Denis Shienkov <denis.shienkov@gmail.com> | 2016-07-13 19:23:56 +0000 |
commit | fbb174127c8f6a5c74db1d4d85e43e8467a16f1c (patch) | |
tree | 2ebca15422b822f9646fcbf1b1e59a14035a3050 /src | |
parent | 86b6a8f27a098d764a5c2f7dc37edb349bd28c3c (diff) | |
download | qtserialport-fbb174127c8f6a5c74db1d4d85e43e8467a16f1c.tar.gz |
Start the write timer only when it is inactive
Change-Id: Ie6dd49bec6add204b45f15ff344ba6c92adedb0a
Reviewed-by: Sergey Belyashov <Sergey.Belyashov@gmail.com>
Reviewed-by: Alex Trotsenko <alex1973tr@gmail.com>
Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/serialport/qserialport_win.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/serialport/qserialport_win.cpp b/src/serialport/qserialport_win.cpp index ae32fcf..46fc9d9 100644 --- a/src/serialport/qserialport_win.cpp +++ b/src/serialport/qserialport_win.cpp @@ -627,7 +627,8 @@ qint64 QSerialPortPrivate::writeData(const char *data, qint64 maxSize) QObjectPrivate::connect(startAsyncWriteTimer, &QTimer::timeout, this, &QSerialPortPrivate::_q_startAsyncWrite); startAsyncWriteTimer->setSingleShot(true); } - startAsyncWriteTimer->start(0); + if (!startAsyncWriteTimer->isActive()) + startAsyncWriteTimer->start(); } return maxSize; } |