summaryrefslogtreecommitdiffstats
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
parent86e0625ea8d0be5127e0213dd834e0f5995cbac3 (diff)
downloadtcl-ef5e016071297f4dcb42c24beabf771feb1f1c68.zip
tcl-ef5e016071297f4dcb42c24beabf771feb1f1c68.tar.gz
tcl-ef5e016071297f4dcb42c24beabf771feb1f1c68.tar.bz2
* generic/tclVar.c (UnsetVarStruct): fixed a leak introduced in
last commit.
-rw-r--r--ChangeLog5
-rw-r--r--generic/tclVar.c9
2 files changed, 13 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 6e76e10..0c8fd00 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2007-06-24 Miguel Sofer <msofer@users.sf.net>
+
+ * generic/tclVar.c (UnsetVarStruct): fixed a leak introduced in
+ last commit.
+
2007-06-23 Miguel Sofer <msofer@users.sf.net>
* generic/tclVar.c (UnsetVarStruct, TclDeleteVars): made the logic
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.