From 9dffc61e276a672ab0bb90e07ccaaabf594ddda7 Mon Sep 17 00:00:00 2001 From: Sebastian Ullrich Date: Thu, 24 Sep 2020 14:06:13 +0200 Subject: [PATCH] fix: free lthread resources on Windows --- src/runtime/thread.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/runtime/thread.cpp b/src/runtime/thread.cpp index d661a8f351..4b5dd20629 100644 --- a/src/runtime/thread.cpp +++ b/src/runtime/thread.cpp @@ -95,6 +95,10 @@ struct lthread::imp { } } + ~imp() { + CloseHandle(m_thread); + } + void join() { if (WaitForSingleObject(m_thread, INFINITE) == WAIT_FAILED) { throw exception("failed to join thread");