From 62e1b1ac577dd9d91fe6685b804bf368333cda34 Mon Sep 17 00:00:00 2001 From: Geert Janssens Date: Fri, 14 Oct 2011 14:57:54 +0000 Subject: [PATCH] Bug #661220 - Critical errors when closing down Gnucash Patch by Robert Fewell git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@21417 57a11ea4-9604-0410-9ed3-97b8803252fd --- src/libqof/qof/qofid.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/libqof/qof/qofid.c b/src/libqof/qof/qofid.c index 255c7d465a..116082b178 100644 --- a/src/libqof/qof/qofid.c +++ b/src/libqof/qof/qofid.c @@ -325,7 +325,8 @@ struct _iterate gpointer data; }; -static void foreach_cb (gpointer key, gpointer item, gpointer arg) +static void +foreach_cb (gpointer item, gpointer arg) { struct _iterate *iter = arg; QofInstance *ent = item; @@ -338,6 +339,7 @@ qof_collection_foreach (const QofCollection *col, QofInstanceForeachCB cb_func, gpointer user_data) { struct _iterate iter; + GList *entries; g_return_if_fail (col); g_return_if_fail (cb_func); @@ -345,7 +347,12 @@ qof_collection_foreach (const QofCollection *col, QofInstanceForeachCB cb_func, iter.fcn = cb_func; iter.data = user_data; - g_hash_table_foreach (col->hash_of_entities, foreach_cb, &iter); -} + PINFO("Hash Table size of %s before is %d", col->e_type, g_hash_table_size(col->hash_of_entities)); + entries = g_hash_table_get_values (col->hash_of_entities); + g_list_foreach (entries, foreach_cb, &iter); + g_list_free (entries); + + PINFO("Hash Table size of %s after is %d", col->e_type, g_hash_table_size(col->hash_of_entities)); +} /* =============================================================== */