summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordkf <donal.k.fellows@manchester.ac.uk>2004-07-11 23:11:21 (GMT)
committerdkf <donal.k.fellows@manchester.ac.uk>2004-07-11 23:11:21 (GMT)
commit6570e4e99c3e50d63954e31e9c6810ed2f55698c (patch)
treec534498bcbfd48dae01aa399ea4862ecd3defc16
parent6052b2df787cde54e20e2833c6a6dbaadb10bdd4 (diff)
downloadtcl-6570e4e99c3e50d63954e31e9c6810ed2f55698c.zip
tcl-6570e4e99c3e50d63954e31e9c6810ed2f55698c.tar.gz
tcl-6570e4e99c3e50d63954e31e9c6810ed2f55698c.tar.bz2
Another leak fix for [Bug 989093]
-rw-r--r--ChangeLog2
-rw-r--r--generic/tclNamesp.c10
2 files changed, 11 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index bcb61cb..c5da103 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,7 @@
2004-07-11 Donal K. Fellows <donal.k.fellows@man.ac.uk>
+ * generic/tclNamesp.c (BuildEnsembleConfig): Don't forget to clean
+ out references when deleting the hash table.
* generic/tclDictObj.c (Tcl_DictObjRemoveKeyList): Oops, forgot to
delete value object when removing the hash entry. [Bug 989093 in part]
diff --git a/generic/tclNamesp.c b/generic/tclNamesp.c
index 88ad3bb..b1e2a8e 100644
--- a/generic/tclNamesp.c
+++ b/generic/tclNamesp.c
@@ -21,7 +21,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclNamesp.c,v 1.40 2004/05/25 19:45:14 msofer Exp $
+ * RCS: @(#) $Id: tclNamesp.c,v 1.41 2004/07/11 23:11:22 dkf Exp $
*/
#include "tclInt.h"
@@ -5262,7 +5262,15 @@ BuildEnsembleConfig(ensemblePtr)
/*
* Remove pre-existing table.
*/
+ Tcl_HashSearch search;
+
ckfree((char *)ensemblePtr->subcommandArrayPtr);
+ hPtr = Tcl_FirstHashEntry(hash, &search);
+ while (hPtr != NULL) {
+ Tcl_Obj *prefixObj = (Tcl_Obj *) Tcl_GetHashValue(hPtr);
+ Tcl_DecrRefCount(prefixObj);
+ hPtr = Tcl_NextHashEntry(&search);
+ }
Tcl_DeleteHashTable(hash);
Tcl_InitHashTable(hash, TCL_STRING_KEYS);
}