Tcl Source Code

Artifact [48e626e24e]
Login

Artifact 48e626e24e27081dfcef051709fb041ccdf0921f:

Attachment "arrayunset3.patch" to ticket [2939073fff] added by ferrieux 2010-02-03 00:32:01.
Index: generic/tclVar.c
===================================================================
RCS file: /cvsroot/tcl/tcl/generic/tclVar.c,v
retrieving revision 1.189
diff -u -p -r1.189 tclVar.c
--- generic/tclVar.c	2 Feb 2010 16:12:00 -0000	1.189
+++ generic/tclVar.c	2 Feb 2010 17:31:05 -0000
@@ -4064,9 +4064,7 @@ ArrayUnsetCmd(
 	 */
 
 	if (varPtr2 == protectedVarPtr) {
-	    if (VarHashRefCount(varPtr2)-- == 1) {
-		CleanupVar(varPtr2, varPtr);
-	    }
+	    VarHashRefCount(protectedVarPtr)--;
 	}
 
 	/*
@@ -4094,12 +4092,13 @@ ArrayUnsetCmd(
 		 */
 
 		if (protectedVarPtr) {
-		    if (VarHashRefCount(protectedVarPtr)-- == 1) {
-			CleanupVar(protectedVarPtr, varPtr);
-		    }
+		    VarHashRefCount(protectedVarPtr);
+		    CleanupVar(protectedVarPtr, varPtr);
 		}
 		return TCL_ERROR;
 	    }
+	} else {
+	    CleanupVar(varPtr2, varPtr);
 	}
     }
     return TCL_OK;