summaryrefslogtreecommitdiffstats
path: root/generic
diff options
context:
space:
mode:
authordkf <donal.k.fellows@manchester.ac.uk>2010-02-03 13:28:43 (GMT)
committerdkf <donal.k.fellows@manchester.ac.uk>2010-02-03 13:28:43 (GMT)
commit6954a8f786583ef8688ed40c560be6dd5125ad12 (patch)
tree04f06bcf3eb91fe6108b50c726dad8088e686e38 /generic
parenta5d1f04218f4616cb7cb69db45ea255a0ffed1fc (diff)
downloadtcl-6954a8f786583ef8688ed40c560be6dd5125ad12.zip
tcl-6954a8f786583ef8688ed40c560be6dd5125ad12.tar.gz
tcl-6954a8f786583ef8688ed40c560be6dd5125ad12.tar.bz2
More corrections to the [array unset] command.
Diffstat (limited to 'generic')
-rw-r--r--generic/tclVar.c13
1 files changed, 6 insertions, 7 deletions
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;