From ef5e016071297f4dcb42c24beabf771feb1f1c68 Mon Sep 17 00:00:00 2001 From: Miguel Sofer Date: Sun, 24 Jun 2007 16:05:28 +0000 Subject: * generic/tclVar.c (UnsetVarStruct): fixed a leak introduced in last commit. --- ChangeLog | 5 +++++ generic/tclVar.c | 9 ++++++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 6e76e10..0c8fd00 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2007-06-24 Miguel Sofer + + * generic/tclVar.c (UnsetVarStruct): fixed a leak introduced in + last commit. + 2007-06-23 Miguel Sofer * 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. -- cgit v0.12