diff options
author | sebres <sebres@users.sourceforge.net> | 2024-05-16 08:56:45 (GMT) |
---|---|---|
committer | sebres <sebres@users.sourceforge.net> | 2024-05-16 08:56:45 (GMT) |
commit | 3ff69480e6926fec03f2336a327f62e0bca928a9 (patch) | |
tree | 851e85ae0be75bf386a7a8809d4fbade4e5ed7c5 /generic | |
parent | 51dc3f20b034af043d0a14d6d79a60c6431baa0d (diff) | |
parent | 03cf1c69bbf2cbf952abeef3db7bf2129756e53b (diff) | |
download | tcl-3ff69480e6926fec03f2336a327f62e0bca928a9.zip tcl-3ff69480e6926fec03f2336a327f62e0bca928a9.tar.gz tcl-3ff69480e6926fec03f2336a327f62e0bca928a9.tar.bz2 |
code review: preserving r/w channels after all possible failures (don't need to release in error case)
Diffstat (limited to 'generic')
-rw-r--r-- | generic/tclIO.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/generic/tclIO.c b/generic/tclIO.c index 2d7612c..d4c52a7 100644 --- a/generic/tclIO.c +++ b/generic/tclIO.c @@ -9186,9 +9186,6 @@ TclCopyChannel( int nonBlocking = (cmdPtr) ? CHANNEL_NONBLOCKING : 0; int moveBytes; - TclChannelPreserve(inChan); - TclChannelPreserve(outChan); - inStatePtr = inPtr->state; outStatePtr = outPtr->state; @@ -9270,6 +9267,9 @@ TclCopyChannel( } csPtr->cmdPtr = cmdPtr; + TclChannelPreserve(inChan); + TclChannelPreserve(outChan); + inStatePtr->csPtrR = csPtr; outStatePtr->csPtrW = csPtr; |