Skip to content

Commit 1b3e1d9

Browse files
lmielicksramasit
authored andcommitted
Fix thread handle leak on Windows (#133)
1 parent 77f3569 commit 1b3e1d9

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)