aboutsummaryrefslogtreecommitdiffstats
path: root/camel/camel-object.c
diff options
context:
space:
mode:
authorJeffrey Stedfast <fejj@ximian.com>2003-05-21 23:32:37 +0800
committerJeffrey Stedfast <fejj@src.gnome.org>2003-05-21 23:32:37 +0800
commit4773ca9f2bf5d0c1e14f3c80af31950ca99c1064 (patch)
treecd7fc09690c27e52129c24d21c19a95af2d3be56 /camel/camel-object.c
parent051f6546155f56e5dd478c9b366aa583948431bc (diff)
downloadgsoc2013-evolution-4773ca9f2bf5d0c1e14f3c80af31950ca99c1064.tar.gz
gsoc2013-evolution-4773ca9f2bf5d0c1e14f3c80af31950ca99c1064.tar.zst
gsoc2013-evolution-4773ca9f2bf5d0c1e14f3c80af31950ca99c1064.zip
Create a second GPtrArray for the keys. We don't want to use
2003-05-20 Jeffrey Stedfast <fejj@ximian.com> * camel-object.c (camel_object_bag_destroy): Create a second GPtrArray for the keys. We don't want to use bag->free_key() on the object. Fixes bug #43406. svn path=/trunk/; revision=21300
Diffstat (limited to 'camel/camel-object.c')
-rw-r--r--camel/camel-object.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/camel/camel-object.c b/camel/camel-object.c
index b96e54675d..7130493864 100644
--- a/camel/camel-object.c
+++ b/camel/camel-object.c
@@ -1107,19 +1107,29 @@ save_object(void *key, CamelObject *o, GPtrArray *objects)
g_ptr_array_add(objects, o);
}
+static void
+save_key(void *key, CamelObject *o, GPtrArray *keys)
+{
+ g_ptr_array_add (keys, key);
+}
+
void camel_object_bag_destroy(CamelObjectBag *bag)
{
- int i;
GPtrArray *objects = g_ptr_array_new();
+ GPtrArray *keys = g_ptr_array_new ();
+ int i;
sem_getvalue(&bag->reserve_sem, &i);
g_assert(i == 1);
g_hash_table_foreach(bag->object_table, (GHFunc)save_object, objects);
+ g_hash_table_foreach(bag->object_table, (GHFunc)save_key, keys);
for (i=0;i<objects->len;i++) {
camel_object_bag_remove(bag, objects->pdata[i]);
- bag->free_key(objects->pdata[i]);
+ bag->free_key (keys->pdata[i]);
}
+
+ g_ptr_array_free (keys, TRUE);
g_ptr_array_free(objects, TRUE);
g_hash_table_destroy(bag->object_table);
g_hash_table_destroy(bag->key_table);