diff options
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | generic/tclInt.h | 8 |
2 files changed, 10 insertions, 3 deletions
@@ -1,3 +1,8 @@ +2007-08-10 Miguel Sofer <msofer@users.sf.net> + + * generic/tclInt.h: fix the TclSetVarNamespaceVar macro, was + causing a leak. + 2007-08-10 Don Porter <dgp@users.sourceforge.net> * generic/tclCompExpr.c: Revise CompileExprTree() to use the diff --git a/generic/tclInt.h b/generic/tclInt.h index f5f7c9b..2fce67b 100644 --- a/generic/tclInt.h +++ b/generic/tclInt.h @@ -12,7 +12,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclInt.h,v 1.330 2007/08/08 18:34:40 msofer Exp $ + * RCS: @(#) $Id: tclInt.h,v 1.331 2007/08/10 18:40:24 msofer Exp $ */ #ifndef _TCLINT @@ -697,8 +697,10 @@ typedef struct VarInHash { (varPtr)->flags &= ~VAR_TRACE_ACTIVE #define TclSetVarNamespaceVar(varPtr) \ - (varPtr)->flags |= VAR_NAMESPACE_VAR;\ - ((VarInHash *)(varPtr))->refCount++ + if (!TclIsVarNamespaceVar(varPtr)) {\ + (varPtr)->flags |= VAR_NAMESPACE_VAR;\ + ((VarInHash *)(varPtr))->refCount++;\ + } #define TclClearVarNamespaceVar(varPtr) \ if (TclIsVarNamespaceVar(varPtr)) {\ |