diff options
author | dkf <dkf@noemail.net> | 2009-01-26 16:25:59 (GMT) |
---|---|---|
committer | dkf <dkf@noemail.net> | 2009-01-26 16:25:59 (GMT) |
commit | f56f4ed0ec870ecf99b8a33e34e72c989beacde3 (patch) | |
tree | 88c00fe6074765780e77395343b29a533a9c1c79 /generic/tclZlib.c | |
parent | 085a16505b3c9daf427fd8b3b4a9cc4358f6ae81 (diff) | |
download | tcl-f56f4ed0ec870ecf99b8a33e34e72c989beacde3.zip tcl-f56f4ed0ec870ecf99b8a33e34e72c989beacde3.tar.gz tcl-f56f4ed0ec870ecf99b8a33e34e72c989beacde3.tar.bz2 |
Fix [Bug 2536400]
FossilOrigin-Name: 45b68fba260d9ecdfca27f2ad2dbf205681a71c4
Diffstat (limited to 'generic/tclZlib.c')
-rw-r--r-- | generic/tclZlib.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/generic/tclZlib.c b/generic/tclZlib.c index 5fefab7..033251b 100644 --- a/generic/tclZlib.c +++ b/generic/tclZlib.c @@ -13,7 +13,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclZlib.c,v 1.21 2008/12/28 17:37:48 dkf Exp $ + * RCS: @(#) $Id: tclZlib.c,v 1.22 2009/01/26 16:25:59 dkf Exp $ */ #include "tclInt.h" @@ -2228,7 +2228,9 @@ ChanClose( e = deflate(&cd->outStream, Z_FINISH); if (e != Z_OK && e != Z_STREAM_END) { /* TODO: is this the right way to do errors on close? */ - ConvertError(interp, e); + if (!TclInThreadExit()) { + ConvertError(interp, e); + } result = TCL_ERROR; break; } @@ -2236,8 +2238,11 @@ ChanClose( if (Tcl_WriteRaw(cd->parent, cd->outBuffer, cd->outAllocated - cd->outStream.avail_out) < 0) { /* TODO: is this the right way to do errors on close? */ - Tcl_AppendResult(interp, "error while finalizing file: ", - Tcl_PosixError(interp), NULL); + if (!TclInThreadExit()) { + Tcl_AppendResult(interp, + "error while finalizing file: ", + Tcl_PosixError(interp), NULL); + } result = TCL_ERROR; break; } @@ -2252,7 +2257,6 @@ ChanClose( ckfree(cd->inBuffer); cd->inBuffer = NULL; } - if (cd->outBuffer) { ckfree(cd->outBuffer); cd->outBuffer = NULL; |