summaryrefslogtreecommitdiffstats
path: root/generic/tclVar.c
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2015-06-30 21:41:18 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2015-06-30 21:41:18 (GMT)
commit27ce2290a6e107aa7e2b8a5995fa32e32106546c (patch)
treed4a008c1cca0c1d8fb3f5fc7c741217ebb7534be /generic/tclVar.c
parentc2ea0fbc1bd362371328c20f5408e45ec4f7770c (diff)
downloadtcl-27ce2290a6e107aa7e2b8a5995fa32e32106546c.zip
tcl-27ce2290a6e107aa7e2b8a5995fa32e32106546c.tar.gz
tcl-27ce2290a6e107aa7e2b8a5995fa32e32106546c.tar.bz2
Consistancy in refcount management.
Diffstat (limited to 'generic/tclVar.c')
-rw-r--r--generic/tclVar.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/generic/tclVar.c b/generic/tclVar.c
index 8fb89cd..97aa7ab 100644
--- a/generic/tclVar.c
+++ b/generic/tclVar.c
@@ -5713,8 +5713,8 @@ FreeNsVarName(
{
register Var *varPtr = objPtr->internalRep.twoPtrValue.ptr2;
- if (TclIsVarInHash(varPtr)) {
- if ((varPtr->refCount-- == 1) && TclIsVarUndefined(varPtr)) {
+ if (TclIsVarInHash(varPtr) && TclIsVarUndefined(varPtr)) {
+ if ((varPtr->refCount-- <= 1)) {
CleanupVar(varPtr, NULL);
}
}