Skip to content

Commit f3447df

Browse files
authored
Fix thread handle leak on Windows (#133)
1 parent 07ea969 commit f3447df

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)