fix leaking thread handles on Windows

On Windows, thread handle should be closed explicitly.

Co-authored-by: luben karavelov <luben@users.noreply.github.com>
This commit is contained in:
Ma Lin
2022-05-30 16:35:44 +08:00
co-authored by luben karavelov
parent 9a5e73c74e
commit 95073b1af1
+2
View File
@@ -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;