summaryrefslogtreecommitdiffstats
path: root/generic/tclInt.h
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 /generic/tclInt.h
parent9789dc88e2250f26f10588c2b602b1aa1212b1d3 (diff)
downloadtcl-6858ad68f90507674fd6110a0058446628bbf230.zip
tcl-6858ad68f90507674fd6110a0058446628bbf230.tar.gz
tcl-6858ad68f90507674fd6110a0058446628bbf230.tar.bz2
* generic/tclInt.h: fix the TclSetVarNamespaceVar macro, was
causing a leak.
Diffstat (limited to 'generic/tclInt.h')
-rw-r--r--generic/tclInt.h8
1 files changed, 5 insertions, 3 deletions
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)) {\