summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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);
}