From 95073b1af1c15a9c3a5344d2e98ff27f41c1d872 Mon Sep 17 00:00:00 2001 From: Ma Lin Date: Mon, 30 May 2022 08:18:54 +0800 Subject: [PATCH] fix leaking thread handles on Windows On Windows, thread handle should be closed explicitly. Co-authored-by: luben karavelov --- lib/common/threading.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/common/threading.c b/lib/common/threading.c index 92cf57c19..4f69f7662 100644 --- a/lib/common/threading.c +++ b/lib/common/threading.c @@ -63,6 +63,8 @@ int ZSTD_pthread_join(ZSTD_pthread_t thread, void **value_ptr) if (!thread.handle) return 0; result = WaitForSingleObject(thread.handle, INFINITE); + CloseHandle(thread.handle); + switch (result) { case WAIT_OBJECT_0: if (value_ptr) *value_ptr = thread.arg; -- 2.47.2