From: Ma Lin Date: Mon, 30 May 2022 00:18:54 +0000 (+0800) Subject: fix leaking thread handles on Windows X-Git-Tag: v1.5.4^2~207^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F3147%2Fhead;p=thirdparty%2Fzstd.git fix leaking thread handles on Windows On Windows, thread handle should be closed explicitly. Co-authored-by: luben karavelov --- 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;