summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMiguel Sofer <miguel.sofer@gmail.com>2007-08-10 18:40:24 (GMT)
committerMiguel Sofer <miguel.sofer@gmail.com>2007-08-10 18:40:24 (GMT)
commit6858ad68f90507674fd6110a0058446628bbf230 (patch)
tree9f352ddfb1e4e855d26e7a29e08bdb64fd6eb9bb
parent9789dc88e2250f26f10588c2b602b1aa1212b1d3 (diff)
downloadtcl-6858ad68f90507674fd6110a0058446628bbf230.zip
tcl-6858ad68f90507674fd6110a0058446628bbf230.tar.gz
tcl-6858ad68f90507674fd6110a0058446628bbf230.tar.bz2
* generic/tclInt.h: fix the TclSetVarNamespaceVar macro, was
causing a leak.
-rw-r--r--ChangeLog5
-rw-r--r--generic/tclInt.h8
2 files changed, 10 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index a7c7b56..b881c80 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -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)) {\