From aaf974ae1e59393c744e995913b87ae18ddd5afa Mon Sep 17 00:00:00 2001 From: hobbs Date: Fri, 12 Apr 2002 06:31:28 +0000 Subject: * generic/tclNotify.c (TclFinalizeNotifier): remove remaining unserviced events on finalization. --- generic/tclNotify.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) 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); -- cgit v0.12