From 34744264e1b6cbfb437e26f970df326dc4367b21 Mon Sep 17 00:00:00 2001 From: Andrew Johnson Date: Mon, 6 May 2013 17:29:10 -0500 Subject: [PATCH] libCom: Fix win32 handle leak Closing an epicsThread would leak one Win32 handle. Reported by Giles Knap, Diamond. --- src/libCom/osi/os/WIN32/osdThread.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/libCom/osi/os/WIN32/osdThread.c b/src/libCom/osi/os/WIN32/osdThread.c index 46c1009c8..a3125e1f5 100644 --- a/src/libCom/osi/os/WIN32/osdThread.c +++ b/src/libCom/osi/os/WIN32/osdThread.c @@ -3,9 +3,8 @@ * National Laboratory. * Copyright (c) 2002 The Regents of the University of California, as * Operator of Los Alamos National Laboratory. -* EPICS BASE Versions 3.13.7 -* and higher are distributed subject to a Software License Agreement found -* in file LICENSE that is included with this distribution. +* EPICS BASE is distributed subject to a Software License Agreement found +* in file LICENSE that is included with this distribution. \*************************************************************************/ /* @@ -246,10 +245,7 @@ static void epicsParmCleanupWIN32 ( win32ThreadParam * pParm ) ellDelete ( & pGbl->threadList, & pParm->node ); LeaveCriticalSection ( & pGbl->mutex ); - /* close the handle if its an implicit thread id */ - if ( ! pParm->funptr ) { - CloseHandle ( pParm->handle ); - } + CloseHandle ( pParm->handle ); free ( pParm ); TlsSetValue ( pGbl->tlsIndexThreadLibraryEPICS, 0 ); }