From 6954a8f786583ef8688ed40c560be6dd5125ad12 Mon Sep 17 00:00:00 2001 From: dkf Date: Wed, 3 Feb 2010 13:28:43 +0000 Subject: More corrections to the [array unset] command. --- ChangeLog | 5 +++++ generic/tclVar.c | 13 ++++++------- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index 83b65a0..df53649 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2010-02-03 Donal K. Fellows + + * generic/tclVar.c (Tcl_ArrayObjCmd): More corrections for the 'unset' + subcommand. + 2010-02-02 Andreas Kupries * generic/tclCompile.c: [Bug 2933089]: A literal sharing problem with diff --git a/generic/tclVar.c b/generic/tclVar.c index 9977975..36db617 100644 --- a/generic/tclVar.c +++ b/generic/tclVar.c @@ -16,7 +16,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclVar.c,v 1.160.2.8 2010/02/02 16:13:46 dkf Exp $ + * RCS: @(#) $Id: tclVar.c,v 1.160.2.9 2010/02/03 13:28:44 dkf Exp $ */ #include "tclInt.h" @@ -3218,9 +3218,7 @@ Tcl_ArrayObjCmd( */ if (varPtr2 == protectedVarPtr) { - if (VarHashRefCount(varPtr2)-- == 1) { - CleanupVar(varPtr2, varPtr); - } + VarHashRefCount(varPtr2)--; } /* @@ -3249,12 +3247,13 @@ Tcl_ArrayObjCmd( */ if (protectedVarPtr) { - if (VarHashRefCount(protectedVarPtr)-- == 1) { - CleanupVar(protectedVarPtr, varPtr); - } + VarHashRefCount(protectedVarPtr)--; + CleanupVar(protectedVarPtr, varPtr); } return TCL_ERROR; } + } else { + CleanupVar(varPtr2, varPtr); } } break; -- cgit v0.12