From df97d69a45ba4e50114458e2b5c4185460f2d9f3 Mon Sep 17 00:00:00 2001 From: crupest Date: Thu, 10 Jun 2021 11:35:29 +0800 Subject: ... --- operating-system-experiment/Thread.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'operating-system-experiment/Thread.cpp') diff --git a/operating-system-experiment/Thread.cpp b/operating-system-experiment/Thread.cpp index 7e3c784..a5f526d 100644 --- a/operating-system-experiment/Thread.cpp +++ b/operating-system-experiment/Thread.cpp @@ -112,7 +112,10 @@ void Thread::Destroy() noexcept { joined_ = false; #ifdef CRU_WINDOWS thread_id_ = 0; - thread_handle_ = nullptr; + if (thread_handle_ != nullptr) { + CloseHandle(thread_handle_); + thread_handle_ = nullptr; + } #else thread_ = nullptr; #endif -- cgit v1.2.3