From 51527e77f838e1e0be4235025a897e33645d2771 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B6nke=20Ludwig?= Date: Tue, 20 Mar 2018 21:03:43 +0100 Subject: [PATCH] Actually close files in the WinAPI driver. --- source/eventcore/drivers/winapi/files.d | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/source/eventcore/drivers/winapi/files.d b/source/eventcore/drivers/winapi/files.d index 03c44ef..d69a3c1 100644 --- a/source/eventcore/drivers/winapi/files.d +++ b/source/eventcore/drivers/winapi/files.d @@ -75,10 +75,8 @@ final class WinAPIEventDriverFiles : EventDriverFiles { { auto h = idToHandle(file); auto slot = () @trusted { return &m_core.m_handles[h].file(); } (); - if (slot.read.overlapped.hEvent != INVALID_HANDLE_VALUE) { - + if (slot.read.overlapped.hEvent != INVALID_HANDLE_VALUE) slot.read.overlapped.hEvent = slot.write.overlapped.hEvent = INVALID_HANDLE_VALUE; - } } override ulong getSize(FileFD file) @@ -160,7 +158,7 @@ final class WinAPIEventDriverFiles : EventDriverFiles { auto h = idToHandle(descriptor); auto slot = &m_core.m_handles[h]; return slot.releaseRef({ - close(descriptor); + CloseHandle(h); m_core.discardEvents(&slot.file.read.overlapped, &slot.file.write.overlapped); m_core.freeSlot(h); });