diff options
Diffstat (limited to 'generic/tclIO.c')
-rw-r--r-- | generic/tclIO.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/generic/tclIO.c b/generic/tclIO.c index 09d0459..776ff12 100644 --- a/generic/tclIO.c +++ b/generic/tclIO.c @@ -2353,7 +2353,7 @@ RecycleBuffer( mustDiscard = 1; } - if (mustDiscard) { + if (1 || mustDiscard) { ReleaseChannelBuffer(bufPtr); return; } @@ -5631,6 +5631,11 @@ DoReadChars( ResetFlag(statePtr, CHANNEL_BLOCKED); } result = GetInput(chanPtr); +if (chanPtr != statePtr->topChanPtr) { +Tcl_Release(chanPtr); +chanPtr = statePtr->topChanPtr; +Tcl_Preserve(chanPtr); +} if (result != 0) { if (result == EAGAIN) { break; |