summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--generic/tclIO.c9
-rw-r--r--tests/iogt.test2
2 files changed, 9 insertions, 2 deletions
diff --git a/generic/tclIO.c b/generic/tclIO.c
index 776ff12..a83cdcd 100644
--- a/generic/tclIO.c
+++ b/generic/tclIO.c
@@ -1876,6 +1876,13 @@ Tcl_UnstackChannel(
* into the old structure.
*/
+ /*
+ * TODO: Figure out how to handle the situation where the chan
+ * operations called below by this unstacking operation cause
+ * another unstacking recursively. In that case the downChanPtr
+ * value we're holding on to will not be the right thing.
+ */
+
Channel *downChanPtr = chanPtr->downChanPtr;
/*
@@ -1980,7 +1987,7 @@ Tcl_UnstackChannel(
*/
Tcl_EventuallyFree(chanPtr, TCL_DYNAMIC);
- UpdateInterest(downChanPtr);
+ UpdateInterest(statePtr->topChanPtr);
if (result != 0) {
Tcl_SetErrno(result);
diff --git a/tests/iogt.test b/tests/iogt.test
index bd3c67b..ded8bb9 100644
--- a/tests/iogt.test
+++ b/tests/iogt.test
@@ -228,7 +228,7 @@ proc id_torture {chan op data} {
delete/read -
clear_read {;#ignore}
flush/write -
- flush/read -
+ flush/read {}
write -
read {
testchannel unstack $chan