summaryrefslogtreecommitdiffstats
path: root/generic
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2014-06-04 16:36:25 (GMT)
committerdgp <dgp@users.sourceforge.net>2014-06-04 16:36:25 (GMT)
commit22e5e3f23f66d83f09a06b80a22a8215ab1dfc24 (patch)
treeaa2c7c56526ecfb8d4c1fa19272d1eee66e96331 /generic
parent3c491801cbe73e305c0024a9b5bd80b7e474cabf (diff)
downloadtcl-22e5e3f23f66d83f09a06b80a22a8215ab1dfc24.zip
tcl-22e5e3f23f66d83f09a06b80a22a8215ab1dfc24.tar.gz
tcl-22e5e3f23f66d83f09a06b80a22a8215ab1dfc24.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?).
Diffstat (limited to 'generic')
-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);
+ }
}
/*