summaryrefslogtreecommitdiffstats
path: root/generic/tclDictObj.c
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2017-09-12 13:22:46 (GMT)
committerdgp <dgp@users.sourceforge.net>2017-09-12 13:22:46 (GMT)
commitb1dc2099c73d4588f26bf86db45046014d647a12 (patch)
treec87375561a6e649ce08b496d58fb1eae7040cb86 /generic/tclDictObj.c
parent89524bf4844ba4249cf17c065af82f7169049e8d (diff)
downloadtcl-b1dc2099c73d4588f26bf86db45046014d647a12.zip
tcl-b1dc2099c73d4588f26bf86db45046014d647a12.tar.gz
tcl-b1dc2099c73d4588f26bf86db45046014d647a12.tar.bz2
When we invalidate the string rep of a dict, that's a sign we need to
free all the intreps of that dict as well.
Diffstat (limited to 'generic/tclDictObj.c')
-rw-r--r--generic/tclDictObj.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/generic/tclDictObj.c b/generic/tclDictObj.c
index f4e15a6..b312fe1 100644
--- a/generic/tclDictObj.c
+++ b/generic/tclDictObj.c
@@ -909,7 +909,11 @@ InvalidateDictChain(
assert( dict != NULL);
do {
+ dict->refCount++;
TclInvalidateStringRep(dictObj);
+ Tcl_FreeIntRep(dictObj);
+ DictSetIntRep(dictObj, dict);
+
dict->epoch++;
dictObj = dict->chain;
if (dictObj == NULL) {