diff options
author | Denis Shienkov <denis.shienkov@gmail.com> | 2014-04-12 17:40:03 +0400 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2014-05-15 11:07:26 +0200 |
commit | 1fc75ea6056b8546e5aea136fe580f97e833b828 (patch) | |
tree | b9a63a86c070a3f445a75691f394660cfa6675ab /src | |
parent | fa1feb5737ef275e1a81f5469161b2bfad7e3f7d (diff) | |
download | qtserialport-1fc75ea6056b8546e5aea136fe580f97e833b828.tar.gz |
Return after an error of the async write operation
Tested on Windows 8 using the on-board and the USB serial
ports and using Qt4 and Qt5.
Change-Id: Idd25b81c9b6b2cd0b94e83fe30e6e7dad4dddfd6
Reviewed-by: Sergey Belyashov <Sergey.Belyashov@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 0f453f5..9b04083 100644 --- a/src/serialport/qserialport_win.cpp +++ b/src/serialport/qserialport_win.cpp @@ -620,10 +620,12 @@ void QSerialPortPrivate::_q_completeAsyncWrite() { Q_Q(QSerialPort); + writeStarted = false; DWORD numberOfBytesTransferred = 0; if (!::GetOverlappedResult(handle, &writeCompletionOverlapped, &numberOfBytesTransferred, FALSE)) { numberOfBytesTransferred = 0; q->setError(decodeSystemError()); + return; } if (numberOfBytesTransferred > 0) { @@ -631,7 +633,6 @@ void QSerialPortPrivate::_q_completeAsyncWrite() emit q->bytesWritten(numberOfBytesTransferred); } - writeStarted = false; startAsyncWrite(); } |