summaryrefslogtreecommitdiffstats
path: root/generic/tclVar.c
diff options
context:
space:
mode:
authordgp@users.sourceforge.net <dgp>2014-07-10 16:40:30 (GMT)
committerdgp@users.sourceforge.net <dgp>2014-07-10 16:40:30 (GMT)
commited656f60eee4a391345ada2ebf1af1e61d0128a3 (patch)
tree814789ffd44685ad57bbf6d5833c06e80fa27979 /generic/tclVar.c
parentd824f372ff798bed3f7f55e5a3aad98156e14dae (diff)
parent3b36bc7ea195aee426528a0a977a0f411237ab60 (diff)
downloadtcl-ed656f60eee4a391345ada2ebf1af1e61d0128a3.zip
tcl-ed656f60eee4a391345ada2ebf1af1e61d0128a3.tar.gz
tcl-ed656f60eee4a391345ada2ebf1af1e61d0128a3.tar.bz2
[7368d225a6] Extend the auto-cleanup of zero ref count values passed in to
the Tcl_*SetVar*() family of routines to cover the missing case where the flags value of TCL_APPEND_VALUE is passed in alone. *** POTENTIAL INCOMAPTIBILITY***
Diffstat (limited to 'generic/tclVar.c')
-rw-r--r--generic/tclVar.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/generic/tclVar.c b/generic/tclVar.c
index 4694cd8..5e3157e 100644
--- a/generic/tclVar.c
+++ b/generic/tclVar.c
@@ -1958,6 +1958,9 @@ TclPtrSetVar(
Tcl_IncrRefCount(oldValuePtr); /* Since var is ref */
}
Tcl_AppendObjToObj(oldValuePtr, newValuePtr);
+ if (newValuePtr->refCount == 0) {
+ Tcl_DecrRefCount(newValuePtr);
+ }
}
}
} else if (newValuePtr != oldValuePtr) {