diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2012-12-29 09:16:43 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2012-12-29 09:16:43 (GMT) |
commit | 53eb119d0b2711c0dc9ec4bdad28ae9c185ca7e4 (patch) | |
tree | d39e09a819b1d12d98bc6bf4dbf3f72ccac830ae /generic | |
parent | 78d91cb25398a571e59790e8ba63206f8a6372ea (diff) | |
parent | 8751239349e355c4983ba5b7fe1696515ab41711 (diff) | |
download | tcl-53eb119d0b2711c0dc9ec4bdad28ae9c185ca7e4.zip tcl-53eb119d0b2711c0dc9ec4bdad28ae9c185ca7e4.tar.gz tcl-53eb119d0b2711c0dc9ec4bdad28ae9c185ca7e4.tar.bz2 |
restore refcounts as they were before the Tcl_ListObjReplace call, in the error situation.
In Tcl9, make this a true Tcl_DecrRefCount, which properly cleans objects with refCount 0
Diffstat (limited to 'generic')
-rw-r--r-- | generic/tclListObj.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/generic/tclListObj.c b/generic/tclListObj.c index 1166759..20b6ec1 100644 --- a/generic/tclListObj.c +++ b/generic/tclListObj.c @@ -906,6 +906,14 @@ Tcl_ListObjReplace( listRepPtr = AttemptNewList(interp, newMax, NULL); if (listRepPtr == NULL) { + for (i = 0; i < objc; i++) { + /* See bug 3598580 */ +#if TCL_MAJOR_VERSION > 8 + Tcl_DecrRefCount(objv[i]); +#else + objv[i]->refCount--; +#endif + } return TCL_ERROR; } |