summaryrefslogtreecommitdiffstats
path: root/win/tclWinSock.c
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2012-11-07 17:36:51 (GMT)
committerdgp <dgp@users.sourceforge.net>2012-11-07 17:36:51 (GMT)
commit010127269bf1a00ec1cb3461e9857ec0feace307 (patch)
treef06e7a7f7936332c6996bb1d848fbf2e097d7199 /win/tclWinSock.c
parentd8462ed0c6fff27176f1c8909aabdb410d11ec70 (diff)
parent0ce2fecd2b2d28ee566c44ec370513b1dae22db7 (diff)
downloadtcl-010127269bf1a00ec1cb3461e9857ec0feace307.zip
tcl-010127269bf1a00ec1cb3461e9857ec0feace307.tar.gz
tcl-010127269bf1a00ec1cb3461e9857ec0feace307.tar.bz2
merge 8.5
Diffstat (limited to 'win/tclWinSock.c')
-rw-r--r--win/tclWinSock.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/win/tclWinSock.c b/win/tclWinSock.c
index 8f2028d..9fa01c9 100644
--- a/win/tclWinSock.c
+++ b/win/tclWinSock.c
@@ -460,14 +460,13 @@ TclpFinalizeSockets(void)
if (tsdPtr != NULL) {
if (tsdPtr->socketThread != NULL) {
if (tsdPtr->hwnd != NULL) {
- PostMessage(tsdPtr->hwnd, SOCKET_TERMINATE, 0, 0);
-
- /*
- * Wait for the thread to exit. This ensures that we are
- * completely cleaned up before we leave this function.
- */
-
- WaitForSingleObject(tsdPtr->readyEvent, INFINITE);
+ if (PostMessage(tsdPtr->hwnd, SOCKET_TERMINATE, 0, 0)) {
+ /*
+ * Wait for the thread to exit. This ensures that we are
+ * completely cleaned up before we leave this function.
+ */
+ WaitForSingleObject(tsdPtr->readyEvent, INFINITE);
+ }
tsdPtr->hwnd = NULL;
}
CloseHandle(tsdPtr->socketThread);