Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/serialport_win.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -453,6 +453,10 @@ void __stdcall ReadIOCompletion(DWORD errorCode, DWORD bytesTransferred, OVERLAP
baton->bytesRead += bytesTransferred;
baton->offset += bytesTransferred;
}
if (!baton->bytesToRead) {
baton->complete = true;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need a CloseHandle(ov->hEvent); here

return;
}

// ReadFileEx and GetOverlappedResult retrieved only 1 byte. Read any additional data in the input
// buffer. Set the timeout to MAXDWORD in order to disable timeouts, so the read operation will
Expand Down