From a6eeae97f39a35937fef286528ad7eb2fc19e652 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B6nke=20Ludwig?= Date: Thu, 20 Jul 2017 16:42:58 +0200 Subject: [PATCH] Fix DirectoryWatcher's creation of its LocalManualEvent. --- source/vibe/core/file.d | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/source/vibe/core/file.d b/source/vibe/core/file.d index bc232ae..b804bf4 100644 --- a/source/vibe/core/file.d +++ b/source/vibe/core/file.d @@ -563,7 +563,7 @@ private void writeDefault(OutputStream, InputStream)(ref OutputStream dst, Input */ struct DirectoryWatcher { // TODO: avoid all those heap allocations! import std.array : Appender, appender; - import vibe.core.sync : LocalManualEvent; + import vibe.core.sync : LocalManualEvent, createManualEvent; @safe: @@ -594,6 +594,7 @@ struct DirectoryWatcher { // TODO: avoid all those heap allocations! private this(NativePath path, bool recursive) { m_context = new Context; // FIME: avoid GC allocation (use FD user data slot) + m_context.changeEvent = createManualEvent(); m_watcher = eventDriver.watchers.watchDirectory(path.toNativeString, recursive, &m_context.onChange); m_context.path = path; m_context.recursive = recursive;