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

Commit 7ee8150

Browse files
lmielicksramasit
authored andcommitted
Fix thread handle leak on Windows (#133)
1 parent c685670 commit 7ee8150

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
@@ -42,6 +42,9 @@ void llvm_thread_join_impl(HANDLE hThread) {
4242
if (::WaitForSingleObject(hThread, INFINITE) == WAIT_FAILED) {
4343
ReportLastErrorFatal("WaitForSingleObject failed");
4444
}
45+
if (::CloseHandle(hThread) == FALSE) {
46+
ReportLastErrorFatal("CloseHandle failed");
47+
}
4548
}
4649

4750
void llvm_thread_detach_impl(HANDLE hThread) {

0 commit comments

Comments
 (0)