Fix ThreadedFileEventDriver event cancellation when not waiting.

This commit is contained in:
Sönke Ludwig 2018-10-02 10:16:26 +02:00
parent de96942501
commit 4e3edf5292

View file

@ -133,7 +133,8 @@ final class ThreadedFileEventDriver(Events : EventDriverEvents) : EventDriverFil
if (m_readyEvent != EventID.invalid) {
log("finishing file events");
m_events.cancelWait(m_readyEvent, &onReady);
if (m_waiting)
m_events.cancelWait(m_readyEvent, &onReady);
onReady(m_readyEvent);
m_events.releaseRef(m_readyEvent);
m_readyEvent = EventID.invalid;