summaryrefslogtreecommitdiffstats
path: root/generic/tclDictObj.c
diff options
context:
space:
mode:
authordkf <donal.k.fellows@manchester.ac.uk>2004-07-11 23:01:28 (GMT)
committerdkf <donal.k.fellows@manchester.ac.uk>2004-07-11 23:01:28 (GMT)
commit6052b2df787cde54e20e2833c6a6dbaadb10bdd4 (patch)
tree3a7cf699bca8d1a1286c3f0fd223db4e5689773b /generic/tclDictObj.c
parentdbcc758ef4555aa231333df80d7d865f6131b6d3 (diff)
downloadtcl-6052b2df787cde54e20e2833c6a6dbaadb10bdd4.zip
tcl-6052b2df787cde54e20e2833c6a6dbaadb10bdd4.tar.gz
tcl-6052b2df787cde54e20e2833c6a6dbaadb10bdd4.tar.bz2
Stop [dict unset] from leaking objects. [Bug 989093 in part]
Diffstat (limited to 'generic/tclDictObj.c')
-rw-r--r--generic/tclDictObj.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/generic/tclDictObj.c b/generic/tclDictObj.c
index c29ac40..4b5f4d4 100644
--- a/generic/tclDictObj.c
+++ b/generic/tclDictObj.c
@@ -9,7 +9,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclDictObj.c,v 1.16 2004/05/27 13:18:53 dkf Exp $
+ * RCS: @(#) $Id: tclDictObj.c,v 1.17 2004/07/11 23:01:28 dkf Exp $
*/
#include "tclInt.h"
@@ -1024,7 +1024,7 @@ Tcl_DictObjDone(searchPtr)
/*
*----------------------------------------------------------------------
*
- * Tcl_DictObjRemoveKeyList --
+ * Tcl_DictObjPutKeyList --
*
* Add a key...key,value pair to a dictionary tree. The main
* dictionary value must not be shared, though sub-dictionaries may
@@ -1122,6 +1122,8 @@ Tcl_DictObjRemoveKeyList(interp, dictPtr, keyc, keyv)
dict = (Dict *) dictPtr->internalRep.otherValuePtr;
hPtr = Tcl_FindHashEntry(&dict->table, (char *)keyv[keyc-1]);
if (hPtr != NULL) {
+ Tcl_Obj *oldValuePtr = (Tcl_Obj *) Tcl_GetHashValue(hPtr);
+ Tcl_DecrRefCount(oldValuePtr);
Tcl_DeleteHashEntry(hPtr);
}
InvalidateDictChain(dictPtr);