diff options
author | vasiljevic <vasiljevic@noemail.net> | 2005-10-04 18:15:09 (GMT) |
---|---|---|
committer | vasiljevic <vasiljevic@noemail.net> | 2005-10-04 18:15:09 (GMT) |
commit | 8d3b433c09ba88080b640e8d23b83e483b904145 (patch) | |
tree | 27c21d14072fc5065a1146a65c8d58bf5aac2872 /generic/tclIO.c | |
parent | 5fbe8370c5a34ea8360ffbdbc5fb0de32b8e5fa6 (diff) | |
download | tcl-8d3b433c09ba88080b640e8d23b83e483b904145.zip tcl-8d3b433c09ba88080b640e8d23b83e483b904145.tar.gz tcl-8d3b433c09ba88080b640e8d23b83e483b904145.tar.bz2 |
Tcl_ClearChannelHandlers(): now deletes any outstanding
timer for the channel. Also, prevents events still in
the event queue from triggering on the current channel.
FossilOrigin-Name: 2c5a4e44969968a02deab05c144a877e168e6798
Diffstat (limited to 'generic/tclIO.c')
-rw-r--r-- | generic/tclIO.c | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/generic/tclIO.c b/generic/tclIO.c index f983a9a..ccc107b 100644 --- a/generic/tclIO.c +++ b/generic/tclIO.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: tclIO.c,v 1.61.2.11 2005/06/22 19:35:16 kennykb Exp $ + * RCS: @(#) $Id: tclIO.c,v 1.61.2.12 2005/10/04 18:15:09 vasiljevic Exp $ */ #include "tclInt.h" @@ -2659,6 +2659,12 @@ Tcl_ClearChannelHandlers (channel) chanPtr = statePtr->topChanPtr; /* + * Cancel any outstanding timer. + */ + + Tcl_DeleteTimerHandler(statePtr->timer); + + /* * Remove any references to channel handlers for this channel that * may be about to be invoked. */ @@ -2696,10 +2702,16 @@ Tcl_ClearChannelHandlers (channel) * will occur if Tcl_DoOneEvent is called before the channel is * finally deleted in FlushChannel. This can happen if the channel * has a background flush active. + * Also, delete all registered file handlers for this channel + * (and for the current thread). This prevents executing of pending + * file-events still sitting in the event queue of the current thread. + * We deliberately do not call UpdateInterest() because this could + * re-schedule new events if the channel still needs to be flushed. */ statePtr->interestMask = 0; - + (chanPtr->typePtr->watchProc)(chanPtr->instanceData, 0); + /* * Remove any EventScript records for this channel. */ |