From 4e3edf52922fe56e232314e3a465eeb8450b986d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B6nke=20Ludwig?= Date: Tue, 2 Oct 2018 10:16:26 +0200 Subject: [PATCH] Fix ThreadedFileEventDriver event cancellation when not waiting. --- source/eventcore/drivers/threadedfile.d | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/source/eventcore/drivers/threadedfile.d b/source/eventcore/drivers/threadedfile.d index e87c99f..e2fcfb2 100644 --- a/source/eventcore/drivers/threadedfile.d +++ b/source/eventcore/drivers/threadedfile.d @@ -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;