summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2014-06-04 16:42:21 (GMT)
committerdgp <dgp@users.sourceforge.net>2014-06-04 16:42:21 (GMT)
commit963ac8c936a669b6d0d9769e53dcd4ff161a9866 (patch)
tree894ba1d33e785ddd117556c66196f81f6cf6aaad
parentda17af7ba7f217bb91eb381f5d3cc6ee1fe3d0ef (diff)
parent22e5e3f23f66d83f09a06b80a22a8215ab1dfc24 (diff)
downloadtcl-963ac8c936a669b6d0d9769e53dcd4ff161a9866.zip
tcl-963ac8c936a669b6d0d9769e53dcd4ff161a9866.tar.gz
tcl-963ac8c936a669b6d0d9769e53dcd4ff161a9866.tar.bz2
Revise DiscardOutput() to account for revisions to the loop in FlushChannel() which is its only caller. We need to discard the curOutPtr buffer as well, and not count on another pass through the loop to attempt to flush it (and raise the same failure again?).
-rw-r--r--generic/tclIO.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/generic/tclIO.c b/generic/tclIO.c
index 998fe5e..9197b06 100644
--- a/generic/tclIO.c
+++ b/generic/tclIO.c
@@ -2503,6 +2503,11 @@ DiscardOutputQueued(
}
statePtr->outQueueHead = NULL;
statePtr->outQueueTail = NULL;
+ bufPtr = statePtr->curOutPtr;
+ if (bufPtr && BytesLeft(bufPtr)) {
+ statePtr->curOutPtr = NULL;
+ RecycleBuffer(statePtr, bufPtr, 0);
+ }
}
/*