summaryrefslogtreecommitdiffstats
path: root/generic/tclIO.c
diff options
context:
space:
mode:
Diffstat (limited to 'generic/tclIO.c')
-rw-r--r--generic/tclIO.c16
1 files changed, 4 insertions, 12 deletions
diff --git a/generic/tclIO.c b/generic/tclIO.c
index 6de1151..9725902 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.4 1998/09/14 18:39:59 stanton Exp $
+ * RCS: @(#) $Id: tclIO.c,v 1.5 1998/10/30 00:38:38 welch Exp $
*/
#include "tclInt.h"
@@ -4520,13 +4520,10 @@ Tcl_NotifyChannel(channel, mask)
NextChannelHandler nh;
/*
- * Prevent the event handler from deleting the channel by incrementing
- * the channel's ref count. Case in point: ChannelEventScriptInvoker()
- * was evaling a script (owned by the channel) which caused the channel
- * to be closed and then the byte codes no longer existed.
+ * Preserve the channel struct in case the script closes it.
*/
- Tcl_RegisterChannel((Tcl_Interp *) NULL, channel);
+ Tcl_Preserve((ClientData) channel);
/*
* If we are flushing in the background, be sure to call FlushChannel
@@ -4574,12 +4571,7 @@ Tcl_NotifyChannel(channel, mask)
UpdateInterest(chanPtr);
}
- /*
- * No longer need to protect the channel from being deleted.
- * After this point it is unsafe to use the value of "channel".
- */
-
- Tcl_UnregisterChannel((Tcl_Interp *) NULL, channel);
+ Tcl_Release((ClientData) channel);
nestedHandlerPtr = nh.nestedHandlerPtr;
}