diff options
author | redman <redman> | 1999-07-29 22:58:22 (GMT) |
---|---|---|
committer | redman <redman> | 1999-07-29 22:58:22 (GMT) |
commit | 2a5093e8452e5ec2c6d52b77e936eda1508cb2f1 (patch) | |
tree | 021c3a6e1efae004d9d428b21de45f1bb6656848 /win/tclWinSock.c | |
parent | 832069eb84869a95bdf0741125e34bc2e672eee1 (diff) | |
download | tcl-2a5093e8452e5ec2c6d52b77e936eda1508cb2f1.zip tcl-2a5093e8452e5ec2c6d52b77e936eda1508cb2f1.tar.gz tcl-2a5093e8452e5ec2c6d52b77e936eda1508cb2f1.tar.bz2 |
win/tclWinSock.c: free Win32 Event handles when destroying socket
helper threads.
Diffstat (limited to 'win/tclWinSock.c')
-rw-r--r-- | win/tclWinSock.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/win/tclWinSock.c b/win/tclWinSock.c index 688df20..7d6651f 100644 --- a/win/tclWinSock.c +++ b/win/tclWinSock.c @@ -8,7 +8,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclWinSock.c,v 1.14 1999/07/27 01:42:25 redman Exp $ + * RCS: @(#) $Id: tclWinSock.c,v 1.15 1999/07/29 22:58:24 redman Exp $ */ #include "tclWinInt.h" @@ -489,6 +489,7 @@ unloadLibrary: tsdPtr->socketThread = NULL; } CloseHandle(tsdPtr->readyEvent); + CloseHandle(tsdPtr->socketListLock); } FreeLibrary(winSock.hInstance); winSock.hInstance = NULL; @@ -583,6 +584,8 @@ SocketThreadExitHandler(clientData) (ThreadSpecificData *)TclThreadDataKeyGet(&dataKey); if (tsdPtr->socketThread != NULL) { + + WaitForSingleObject(tsdPtr->socketListLock, INFINITE); Tcl_MutexLock(&socketMutex); TerminateThread(tsdPtr->socketThread, 0); @@ -592,6 +595,8 @@ SocketThreadExitHandler(clientData) */ WaitForSingleObject(tsdPtr->socketThread, INFINITE); + CloseHandle(tsdPtr->readyEvent); + CloseHandle(tsdPtr->socketListLock); Tcl_MutexUnlock(&socketMutex); } if (tsdPtr->hwnd != NULL) { |