Skip to content

Commit 125c2fc

Browse files
lmielicksramasit
authored andcommitted
Fix thread handle leak on Windows (intel#133)
1 parent 0ef94a9 commit 125c2fc

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)