summaryrefslogtreecommitdiffstats
path: root/generic
diff options
context:
space:
mode:
authorMiguel Sofer <miguel.sofer@gmail.com>2007-06-24 16:05:28 (GMT)
committerMiguel Sofer <miguel.sofer@gmail.com>2007-06-24 16:05:28 (GMT)
commitef5e016071297f4dcb42c24beabf771feb1f1c68 (patch)
tree162877abf8c867c44a139f86868d251b8b08b8ef /generic
parent86e0625ea8d0be5127e0213dd834e0f5995cbac3 (diff)
downloadtcl-ef5e016071297f4dcb42c24beabf771feb1f1c68.zip
tcl-ef5e016071297f4dcb42c24beabf771feb1f1c68.tar.gz
tcl-ef5e016071297f4dcb42c24beabf771feb1f1c68.tar.bz2
* generic/tclVar.c (UnsetVarStruct): fixed a leak introduced in
last commit.
Diffstat (limited to 'generic')
-rw-r--r--generic/tclVar.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/generic/tclVar.c b/generic/tclVar.c
index 576aa0a..e7ee850 100644
--- a/generic/tclVar.c
+++ b/generic/tclVar.c
@@ -15,7 +15,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.138 2007/06/23 18:13:01 msofer Exp $
+ * RCS: @(#) $Id: tclVar.c,v 1.139 2007/06/24 16:05:29 msofer Exp $
*/
#include "tclInt.h"
@@ -2181,6 +2181,13 @@ UnsetVarStruct(
}
}
+ if (!reachable) {
+ TclSetVarUndefined(varPtr);
+ TclSetVarScalar(varPtr);
+ varPtr->tracePtr = NULL;
+ varPtr->searchPtr = NULL;
+ }
+
/*
* If the variable was a namespace variable, decrement its reference
* count.