From bf14f11c637d99ef6bea288be84e26f551de5693 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Thu, 27 Dec 2012 20:54:31 +0000 Subject: restore old refcounts in TCL_ERROR case. --- generic/tclListObj.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/generic/tclListObj.c b/generic/tclListObj.c index 1166759..97e7152 100644 --- a/generic/tclListObj.c +++ b/generic/tclListObj.c @@ -906,6 +906,9 @@ Tcl_ListObjReplace( listRepPtr = AttemptNewList(interp, newMax, NULL); if (listRepPtr == NULL) { + for (i = 0; i < objc; i++) { + objv[i]->refCount--; + } return TCL_ERROR; } -- cgit v0.12 From 8751239349e355c4983ba5b7fe1696515ab41711 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Sat, 29 Dec 2012 00:06:42 +0000 Subject: For Tcl9, do a real Tcl_DecrRefCount --- generic/tclListObj.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/generic/tclListObj.c b/generic/tclListObj.c index 97e7152..5b73a155 100644 --- a/generic/tclListObj.c +++ b/generic/tclListObj.c @@ -907,7 +907,11 @@ Tcl_ListObjReplace( listRepPtr = AttemptNewList(interp, newMax, NULL); if (listRepPtr == NULL) { for (i = 0; i < objc; i++) { +#if TCL_MAJOR_VERSION > 8 + Tcl_DecrRefCount(objv[i]); +#else objv[i]->refCount--; +#endif } return TCL_ERROR; } -- cgit v0.12