summaryrefslogtreecommitdiffstats
path: root/generic/tclVar.c
diff options
context:
space:
mode:
authorMiguel Sofer <miguel.sofer@gmail.com>2008-03-11 17:23:55 (GMT)
committerMiguel Sofer <miguel.sofer@gmail.com>2008-03-11 17:23:55 (GMT)
commit927fbda30f0ee4a5e2201dc1539f392e15a19412 (patch)
tree3f10b8bebe2f1a1dfe78dd02550643abd4c6dc38 /generic/tclVar.c
parent032b8525dfad7e63cfb32a637325cb23af6409d6 (diff)
downloadtcl-927fbda30f0ee4a5e2201dc1539f392e15a19412.zip
tcl-927fbda30f0ee4a5e2201dc1539f392e15a19412.tar.gz
tcl-927fbda30f0ee4a5e2201dc1539f392e15a19412.tar.bz2
* generic/tclVar.c (TclDeleteNamespaceVars):
* tests/var.test (var-8.2): unset traces on vars should be called with a FQ named during namespace deletion. This was causing infinite loops when unset traces recreated the var, as reported by Julian Noble on [Bug 1911919].
Diffstat (limited to 'generic/tclVar.c')
-rw-r--r--generic/tclVar.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/generic/tclVar.c b/generic/tclVar.c
index 1c7a7f7..3bcc527 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.159 2007/12/13 15:23:21 dgp Exp $
+ * RCS: @(#) $Id: tclVar.c,v 1.160 2008/03/11 17:23:56 msofer Exp $
*/
#include "tclInt.h"
@@ -4360,10 +4360,16 @@ TclDeleteNamespaceVars(
for (varPtr = VarHashFirstVar(tablePtr, &search); varPtr != NULL;
varPtr = VarHashFirstVar(tablePtr, &search)) {
+ Tcl_Obj *objPtr = Tcl_NewObj();
+ Tcl_IncrRefCount(objPtr);
+
VarHashRefCount(varPtr)++; /* Make sure we get to remove from
* hash. */
- UnsetVarStruct(varPtr, NULL, iPtr, /* part1 */ VarHashGetKey(varPtr),
+ Tcl_GetVariableFullName(interp, (Tcl_Var) varPtr, objPtr);
+ UnsetVarStruct(varPtr, NULL, iPtr, /* part1 */ objPtr,
NULL, flags);
+ Tcl_DecrRefCount(objPtr); /* free no longer needed obj */
+
/*
* Remove the variable from the table and force it undefined in case