diff options
author | dgp <dgp@users.sourceforge.net> | 2014-05-16 14:47:59 (GMT) |
---|---|---|
committer | dgp <dgp@users.sourceforge.net> | 2014-05-16 14:47:59 (GMT) |
commit | 0c97f2ebb010c257374052fb66f737f99cb1e018 (patch) | |
tree | f40ad72828d9fa3a5dc4a59ede2dee8daed72706 /generic | |
parent | 6f8a00dcd5a10e71caf9e3d2f7067523c4ff0b28 (diff) | |
parent | 267fb4eebd7345f715153cea17de47c2396d31f8 (diff) | |
download | tcl-0c97f2ebb010c257374052fb66f737f99cb1e018.zip tcl-0c97f2ebb010c257374052fb66f737f99cb1e018.tar.gz tcl-0c97f2ebb010c257374052fb66f737f99cb1e018.tar.bz2 |
merge 8.5bug_io_32_11
Diffstat (limited to 'generic')
-rw-r--r-- | generic/tclIO.c | 1 | ||||
-rw-r--r-- | generic/tclIORChan.c | 12 |
2 files changed, 11 insertions, 2 deletions
diff --git a/generic/tclIO.c b/generic/tclIO.c index f42d390..7a53373 100644 --- a/generic/tclIO.c +++ b/generic/tclIO.c @@ -12,7 +12,6 @@ * this file, and for a DISCLAIMER OF ALL WARRANTIES. */ -#undef NDEBUG #include "tclInt.h" #include "tclIO.h" #include <assert.h> diff --git a/generic/tclIORChan.c b/generic/tclIORChan.c index 7630473..3107f9e 100644 --- a/generic/tclIORChan.c +++ b/generic/tclIORChan.c @@ -438,8 +438,8 @@ static const char *msg_write_nothing = "{write wrote nothing}"; static const char *msg_seek_beforestart = "{Tried to seek before origin}"; #ifdef TCL_THREADS static const char *msg_send_originlost = "{Channel thread lost}"; -static const char *msg_send_dstlost = "{Owner lost}"; #endif /* TCL_THREADS */ +static const char *msg_send_dstlost = "{Owner lost}"; static const char *msg_dstlost = "-code 1 -level 0 -errorcode NONE -errorinfo {} -errorline 1 {Owner lost}"; /* @@ -1302,6 +1302,7 @@ ReflectOutput( /* ASSERT: rcPtr->mode & TCL_WRITABLE */ Tcl_Preserve(rcPtr); + Tcl_Preserve(rcPtr->interp); bufObj = Tcl_NewByteArrayObj((unsigned char *) buf, toWrite); Tcl_IncrRefCount(bufObj); @@ -1318,6 +1319,14 @@ ReflectOutput( goto invalid; } + if (Tcl_InterpDeleted(rcPtr->interp)) { + /* + * The interp was destroyed during InvokeTclMethod(). + */ + + SetChannelErrorStr(rcPtr->chan, msg_send_dstlost); + goto invalid; + } if (Tcl_GetIntFromObj(rcPtr->interp, resObj, &written) != TCL_OK) { Tcl_SetChannelError(rcPtr->chan, MarshallError(rcPtr->interp)); goto invalid; @@ -1347,6 +1356,7 @@ ReflectOutput( stop: Tcl_DecrRefCount(bufObj); Tcl_DecrRefCount(resObj); /* Remove reference held from invoke */ + Tcl_Release(rcPtr->interp); Tcl_Release(rcPtr); return written; invalid: |