diff options
author | dkf <donal.k.fellows@manchester.ac.uk> | 2004-07-11 23:01:28 (GMT) |
---|---|---|
committer | dkf <donal.k.fellows@manchester.ac.uk> | 2004-07-11 23:01:28 (GMT) |
commit | 6052b2df787cde54e20e2833c6a6dbaadb10bdd4 (patch) | |
tree | 3a7cf699bca8d1a1286c3f0fd223db4e5689773b | |
parent | dbcc758ef4555aa231333df80d7d865f6131b6d3 (diff) | |
download | tcl-6052b2df787cde54e20e2833c6a6dbaadb10bdd4.zip tcl-6052b2df787cde54e20e2833c6a6dbaadb10bdd4.tar.gz tcl-6052b2df787cde54e20e2833c6a6dbaadb10bdd4.tar.bz2 |
Stop [dict unset] from leaking objects. [Bug 989093 in part]
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | generic/tclDictObj.c | 6 |
2 files changed, 9 insertions, 2 deletions
@@ -1,3 +1,8 @@ +2004-07-11 Donal K. Fellows <donal.k.fellows@man.ac.uk> + + * generic/tclDictObj.c (Tcl_DictObjRemoveKeyList): Oops, forgot to + delete value object when removing the hash entry. [Bug 989093 in part] + 2004-07-11 Miguel Sofer <msofer@users.sf.net> * generic/tclExecute.c (TEBC): fixed leak of expandNestList objs 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); |