summaryrefslogtreecommitdiffstats
path: root/generic
diff options
context:
space:
mode:
authorhobbs <hobbs>2002-03-01 06:22:31 (GMT)
committerhobbs <hobbs>2002-03-01 06:22:31 (GMT)
commitca95a8f7abfc1d516e3cdec6eaa2138fdc8bcc5d (patch)
tree374897c326043b3152ad41530154aa58d4974065 /generic
parentabca3bbbb671d4175e9635c34a9ade4e53334b2e (diff)
downloadtcl-ca95a8f7abfc1d516e3cdec6eaa2138fdc8bcc5d.zip
tcl-ca95a8f7abfc1d516e3cdec6eaa2138fdc8bcc5d.tar.gz
tcl-ca95a8f7abfc1d516e3cdec6eaa2138fdc8bcc5d.tar.bz2
* generic/tclTimer.c (TimerExitProc): remove remaining events in
tls on thread exit.
Diffstat (limited to 'generic')
-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;
+ }
+ }
}
/*