1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-10 23:44:24 +00:00

IPC: Fix occasional windows crash

As far as I can tell, if a read was cancelled from a background thread,
the IO operation wasn't cancelled, so the system was poking at the
stack-allocated OVERLAPPED structure after it had been removed from the
stack, at which point something else might be occupying that region of
stack memory.

I'm pretty sure Address Sanitizer should be able to catch this sort of
thing so I'm surprised it didn't complain here.
This commit is contained in:
reuk 2020-11-20 12:12:35 +00:00
parent 84be2fea9a
commit 9b90398cf9
No known key found for this signature in database
GPG key ID: 9ADCD339CFC98A11

View file

@ -1150,7 +1150,10 @@ private:
bool waitForIO (OverlappedEvent& over, int timeOutMilliseconds)
{
if (shouldStop)
{
CancelIo (pipeH);
return false;
}
HANDLE handles[] = { over.over.hEvent, cancelEvent };
DWORD waitResult = WaitForMultipleObjects (2, handles, FALSE,