summaryrefslogtreecommitdiffstats
path: root/generic/tclNotify.c
diff options
context:
space:
mode:
authorhobbs <hobbs>2002-04-12 06:31:28 (GMT)
committerhobbs <hobbs>2002-04-12 06:31:28 (GMT)
commitaaf974ae1e59393c744e995913b87ae18ddd5afa (patch)
tree05e2e92bc2a881c40aded5cfe133476fc8b7d851 /generic/tclNotify.c
parenta8f0bfd4bf052b0ff93b876f5aa974b8108a3b22 (diff)
downloadtcl-aaf974ae1e59393c744e995913b87ae18ddd5afa.zip
tcl-aaf974ae1e59393c744e995913b87ae18ddd5afa.tar.gz
tcl-aaf974ae1e59393c744e995913b87ae18ddd5afa.tar.bz2
* generic/tclNotify.c (TclFinalizeNotifier): remove remaining
unserviced events on finalization.
Diffstat (limited to 'generic/tclNotify.c')
-rw-r--r--generic/tclNotify.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/generic/tclNotify.c b/generic/tclNotify.c
index 8c93cef..2f32adc 100644
--- a/generic/tclNotify.c
+++ b/generic/tclNotify.c
@@ -13,7 +13,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclNotify.c,v 1.7 2000/04/04 20:28:42 kupries Exp $
+ * RCS: @(#) $Id: tclNotify.c,v 1.8 2002/04/12 06:31:28 hobbs Exp $
*/
#include "tclInt.h"
@@ -146,6 +146,17 @@ TclFinalizeNotifier()
{
ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey);
ThreadSpecificData **prevPtrPtr;
+ Tcl_Event *evPtr, *hold;
+
+ Tcl_MutexLock(&(tsdPtr->queueMutex));
+ for (evPtr = tsdPtr->firstEventPtr; evPtr != (Tcl_Event *) NULL; ) {
+ hold = evPtr;
+ evPtr = evPtr->nextPtr;
+ ckfree((char *) hold);
+ }
+ tsdPtr->firstEventPtr = NULL;
+ tsdPtr->lastEventPtr = NULL;
+ Tcl_MutexUnlock(&(tsdPtr->queueMutex));
Tcl_MutexLock(&listLock);