summaryrefslogtreecommitdiffstats
path: root/generic/tclZlib.c
diff options
context:
space:
mode:
authordkf <donal.k.fellows@manchester.ac.uk>2009-01-26 16:25:59 (GMT)
committerdkf <donal.k.fellows@manchester.ac.uk>2009-01-26 16:25:59 (GMT)
commit06246dc255be570cc95cf8e6234f079b4b93f94a (patch)
tree88c00fe6074765780e77395343b29a533a9c1c79 /generic/tclZlib.c
parent4d2c8ff94995922844eb90c417935958838c36d0 (diff)
downloadtcl-06246dc255be570cc95cf8e6234f079b4b93f94a.zip
tcl-06246dc255be570cc95cf8e6234f079b4b93f94a.tar.gz
tcl-06246dc255be570cc95cf8e6234f079b4b93f94a.tar.bz2
Fix [Bug 2536400]
Diffstat (limited to 'generic/tclZlib.c')
-rw-r--r--generic/tclZlib.c14
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;