summaryrefslogtreecommitdiffstats
path: root/generic/tclTimer.c
diff options
context:
space:
mode:
authorhobbs <hobbs@noemail.net>2002-03-01 06:22:30 (GMT)
committerhobbs <hobbs@noemail.net>2002-03-01 06:22:30 (GMT)
commit2311336eccba80bce9d9dd6f6387db7cd39d921d (patch)
tree374897c326043b3152ad41530154aa58d4974065 /generic/tclTimer.c
parentfa3aa7ad954a44e422b7062ad1894a83a8a95aea (diff)
downloadtcl-2311336eccba80bce9d9dd6f6387db7cd39d921d.zip
tcl-2311336eccba80bce9d9dd6f6387db7cd39d921d.tar.gz
tcl-2311336eccba80bce9d9dd6f6387db7cd39d921d.tar.bz2
* generic/tclTimer.c (TimerExitProc): remove remaining events in
tls on thread exit. FossilOrigin-Name: b15a270a3d0257cabe8e65b1f29e96ded21694b3
Diffstat (limited to 'generic/tclTimer.c')
-rw-r--r--generic/tclTimer.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/generic/tclTimer.c b/generic/tclTimer.c
index 33b312d..25ff9b2 100644
--- a/generic/tclTimer.c
+++ b/generic/tclTimer.c
@@ -9,7 +9,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclTimer.c,v 1.5 2002/01/17 04:37:33 dgp Exp $
+ * RCS: @(#) $Id: tclTimer.c,v 1.6 2002/03/01 06:22:31 hobbs Exp $
*/
#include "tclInt.h"
@@ -174,7 +174,7 @@ InitTimer()
* None.
*
* Side effects:
- * Removes the timer and idle event sources.
+ * Removes the timer and idle event sources and remaining events.
*
*----------------------------------------------------------------------
*/
@@ -183,7 +183,19 @@ static void
TimerExitProc(clientData)
ClientData clientData; /* Not used. */
{
+ ThreadSpecificData *tsdPtr =
+ (ThreadSpecificData *) TclThreadDataKeyGet(&dataKey);
+
Tcl_DeleteEventSource(TimerSetupProc, TimerCheckProc, NULL);
+ if (tsdPtr != NULL) {
+ register TimerHandler *timerHandlerPtr;
+ timerHandlerPtr = tsdPtr->firstTimerHandlerPtr;
+ while (timerHandlerPtr != NULL) {
+ tsdPtr->firstTimerHandlerPtr = timerHandlerPtr->nextPtr;
+ ckfree((char *) timerHandlerPtr);
+ timerHandlerPtr = tsdPtr->firstTimerHandlerPtr;
+ }
+ }
}
/*