summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog7
-rw-r--r--win/tclWinSock.c7
2 files changed, 12 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 0b8f05d..0a51b5e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,4 +1,9 @@
-1999-07-28 Jennifer Hom <jenn@scriptics.com>
+1999-07-29 <redman@scriptics.com>
+
+ * win/tclWinSock.c: Free Win32 Event handles when destroying
+ the socket helper thread.
+
+1999-07-28 <jenn@scriptics.com>
* tests/tcltest.test:
* library/tcltest1.0/tcltest.tcl: Fixed the condition under which
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) {