diff options
author | dgp <dgp@users.sourceforge.net> | 2014-04-21 19:04:08 (GMT) |
---|---|---|
committer | dgp <dgp@users.sourceforge.net> | 2014-04-21 19:04:08 (GMT) |
commit | 5407657340a624d763a1c122624a5b5da218f911 (patch) | |
tree | 812d23cc45f6ea63bd523ba8fc2c441a5c0d297f /generic/tclIOCmd.c | |
parent | a1e839f080f7946041e6934a91baefb9da50ba61 (diff) | |
parent | a07adf4d6d28771d9aa74ef06526e5fb3035f5c1 (diff) | |
download | tcl-5407657340a624d763a1c122624a5b5da218f911.zip tcl-5407657340a624d763a1c122624a5b5da218f911.tar.gz tcl-5407657340a624d763a1c122624a5b5da218f911.tar.bz2 |
Merge refcounting machinery for ChannelBuffer.
Diffstat (limited to 'generic/tclIOCmd.c')
-rw-r--r-- | generic/tclIOCmd.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/generic/tclIOCmd.c b/generic/tclIOCmd.c index 1673bce..d5ac64d 100644 --- a/generic/tclIOCmd.c +++ b/generic/tclIOCmd.c @@ -453,6 +453,7 @@ Tcl_ReadObjCmd( resultPtr = Tcl_NewObj(); Tcl_IncrRefCount(resultPtr); + Tcl_Preserve(chan); charactersRead = Tcl_ReadChars(chan, resultPtr, toRead, 0); if (charactersRead < 0) { /* @@ -467,6 +468,7 @@ Tcl_ReadObjCmd( "error reading \"%s\": %s", TclGetString(chanObjPtr), Tcl_PosixError(interp))); } + Tcl_Release(chan); Tcl_DecrRefCount(resultPtr); return TCL_ERROR; } @@ -485,6 +487,7 @@ Tcl_ReadObjCmd( } } Tcl_SetObjResult(interp, resultPtr); + Tcl_Release(chan); Tcl_DecrRefCount(resultPtr); return TCL_OK; } |