summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordgp@users.sourceforge.net <dgp>2014-06-04 16:36:25 (GMT)
committerdgp@users.sourceforge.net <dgp>2014-06-04 16:36:25 (GMT)
commit55764fb57faee71ae3f09b9b7c2c69343282382b (patch)
treeaa2c7c56526ecfb8d4c1fa19272d1eee66e96331
parent7b773e75ef469d072dd1c4eba6c18b7bde4ff98e (diff)
downloadtcl-55764fb57faee71ae3f09b9b7c2c69343282382b.zip
tcl-55764fb57faee71ae3f09b9b7c2c69343282382b.tar.gz
tcl-55764fb57faee71ae3f09b9b7c2c69343282382b.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 ed94bfe..b7135e9 100644
--- a/generic/tclIO.c
+++ b/generic/tclIO.c
@@ -2415,6 +2415,11 @@ DiscardOutputQueued(
}
statePtr->outQueueHead = NULL;
statePtr->outQueueTail = NULL;
+ bufPtr = statePtr->curOutPtr;
+ if (bufPtr && BytesLeft(bufPtr)) {
+ statePtr->curOutPtr = NULL;
+ RecycleBuffer(statePtr, bufPtr, 0);
+ }
}
/*