summaryrefslogtreecommitdiffstats
path: root/win/tclWinNotify.c
diff options
context:
space:
mode:
Diffstat (limited to 'win/tclWinNotify.c')
-rw-r--r--win/tclWinNotify.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/win/tclWinNotify.c b/win/tclWinNotify.c
index d788086..5df1e8d 100644
--- a/win/tclWinNotify.c
+++ b/win/tclWinNotify.c
@@ -10,7 +10,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclWinNotify.c,v 1.9 2001/11/21 02:36:21 hobbs Exp $
+ * RCS: @(#) $Id: tclWinNotify.c,v 1.10 2001/12/14 10:32:47 dkf Exp $
*/
#include "tclWinInt.h"
@@ -147,6 +147,20 @@ Tcl_FinalizeNotifier(clientData)
{
ThreadSpecificData *tsdPtr = (ThreadSpecificData *) clientData;
+ /*
+ * Only finalize the notifier if a notifier was installed in the
+ * current thread; there is a route in which this is not
+ * guaranteed to be true (when tclWin32Dll.c:DllMain() is called
+ * with the flag DLL_PROCESS_DETACH by the OS, which could be
+ * doing so from a thread that's never previously been involved
+ * with Tcl, e.g. the task manager) so this check is important.
+ *
+ * Fixes Bug #217982 reported by Hugh Vu and Gene Leache.
+ */
+ if (tsdPtr == NULL) {
+ return;
+ }
+
DeleteCriticalSection(&tsdPtr->crit);
CloseHandle(tsdPtr->event);