Skip to content
This repository was archived by the owner on Nov 27, 2025. It is now read-only.

Commit 5863d13

Browse files
committed
Fix thread handle leak on Windows
1 parent 07ea969 commit 5863d13

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

llvm/lib/Support/Windows/Threading.inc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,9 @@ void llvm_thread_join_impl(HANDLE hThread) {
4141
if (::WaitForSingleObject(hThread, INFINITE) == WAIT_FAILED) {
4242
ReportLastErrorFatal("WaitForSingleObject failed");
4343
}
44+
if (::CloseHandle(hThread) == FALSE) {
45+
ReportLastErrorFatal("CloseHandle failed");
46+
}
4447
}
4548

4649
void llvm_thread_detach_impl(HANDLE hThread) {

0 commit comments

Comments
 (0)