mirror of
https://github.com/StrikerX3/StrikeBox.git
synced 2024-06-23 14:53:22 -04:00
Fix infinite loop and occasional crashes on shutdown in Win32 serial driver
This commit is contained in:
parent
c39df02a04
commit
11d870a555
|
@ -16,7 +16,7 @@ void Win32SerialDriver::ReaderFunc(void *userData, uint8_t *buf, uint32_t len) {
|
|||
while (len > 0) {
|
||||
int lenRecv = min(driver->CanReceive(), len);
|
||||
if (lenRecv == 0) {
|
||||
continue;
|
||||
break;
|
||||
}
|
||||
driver->Receive(buf, lenRecv);
|
||||
len -= lenRecv;
|
||||
|
@ -61,7 +61,7 @@ void Win32SerialDriver::Stop() {
|
|||
}
|
||||
|
||||
void Win32SerialDriver::Close() {
|
||||
m_comm->Stop();
|
||||
m_comm->Stop(true);
|
||||
|
||||
Event(CHR_EVENT_CLOSED);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue