[llvm] Fix thread handle leak on Windows (PR #156854)

Alexandre Ganea via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 4 11:25:57 PDT 2025


================
@@ -42,6 +42,9 @@ void llvm_thread_join_impl(HANDLE hThread) {
   if (::WaitForSingleObject(hThread, INFINITE) == WAIT_FAILED) {
     ReportLastErrorFatal("WaitForSingleObject failed");
   }
+  if (::CloseHandle(hThread) == FALSE) {
----------------
aganea wrote:

nit: The brackets don't follow [this LLVM coding standard guideline](https://llvm.org/docs/CodingStandards.html#don-t-use-braces-on-simple-single-statement-bodies-of-if-else-loop-statements) (but I know, it looks like the whole file is like that). I think we should stick to the guidelines to keep the codebase uniform.

https://github.com/llvm/llvm-project/pull/156854


More information about the llvm-commits mailing list