summaryrefslogtreecommitdiffstats
path: root/generic/tclVar.c
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2014-07-10 15:45:32 (GMT)
committerdgp <dgp@users.sourceforge.net>2014-07-10 15:45:32 (GMT)
commitb81d871afb75e89084b40119c3668bf010d43786 (patch)
treeb0a0b590d3ffd626bae11919d4b5785d09de8449 /generic/tclVar.c
parent61f8119019659d9aa43dc2833938475de8f1a85a (diff)
downloadtcl-b81d871afb75e89084b40119c3668bf010d43786.zip
tcl-b81d871afb75e89084b40119c3668bf010d43786.tar.gz
tcl-b81d871afb75e89084b40119c3668bf010d43786.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 12d6911..fda5ff5 100644
--- a/generic/tclVar.c
+++ b/generic/tclVar.c
@@ -1916,6 +1916,9 @@ TclPtrSetVar(
Tcl_IncrRefCount(oldValuePtr); /* Since var is ref */
}
Tcl_AppendObjToObj(oldValuePtr, newValuePtr);
+ if (newValuePtr->refCount == 0) {
+ Tcl_DecrRefCount(newValuePtr);
+ }
}
}
} else if (newValuePtr != oldValuePtr) {