From: Gurusamy Sarathy Date: Fri, 20 Feb 1998 22:31:56 +0000 (+0000) Subject: [win32] fix handle leak in join() X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=8e11982ff88bf2a04ea22585cb810590a08f6abf;p=p5sagit%2Fp5-mst-13.2.git [win32] fix handle leak in join() p4raw-id: //depot/win32/perl@566 --- diff --git a/win32/win32thread.h b/win32/win32thread.h index acb136c..512e629 100644 --- a/win32/win32thread.h +++ b/win32/win32thread.h @@ -166,7 +166,8 @@ END_EXTERN_C #define JOIN(t, avp) \ STMT_START { \ if ((WaitForSingleObject((t)->self,INFINITE) == WAIT_FAILED) \ - || (GetExitCodeThread((t)->self,(LPDWORD)(avp)) == 0)) \ + || (GetExitCodeThread((t)->self,(LPDWORD)(avp)) == 0) \ + || (CloseHandle((t)->self) == 0)) \ croak("panic: JOIN"); \ *avp = (AV *)((t)->i.retv); \ } STMT_END @@ -174,7 +175,8 @@ END_EXTERN_C #define JOIN(t, avp) \ STMT_START { \ if ((WaitForSingleObject((t)->self,INFINITE) == WAIT_FAILED) \ - || (GetExitCodeThread((t)->self,(LPDWORD)(avp)) == 0)) \ + || (GetExitCodeThread((t)->self,(LPDWORD)(avp)) == 0) \ + || (CloseHandle((t)->self) == 0)) \ croak("panic: JOIN"); \ } STMT_END #endif /* !USE_RTL_THREAD_API || _MSC_VER */