aboutsummaryrefslogtreecommitdiffstats
path: root/camel/camel-object.c
diff options
context:
space:
mode:
authorDan Winship <danw@src.gnome.org>2001-04-14 05:36:09 +0800
committerDan Winship <danw@src.gnome.org>2001-04-14 05:36:09 +0800
commit044fde0583993fae3ec3c511ac0a5058c5745302 (patch)
tree4d60e4dc752d79d4477c80f9d5897e6e8970baed /camel/camel-object.c
parentdaea2fb545d62492d6b202adda8bdf52f08205eb (diff)
downloadgsoc2013-evolution-044fde0583993fae3ec3c511ac0a5058c5745302.tar.gz
gsoc2013-evolution-044fde0583993fae3ec3c511ac0a5058c5745302.tar.zst
gsoc2013-evolution-044fde0583993fae3ec3c511ac0a5058c5745302.zip
Plug leaks.
* camel-object.c (camel_object_hook_event): * camel-uid-cache.c (camel_uid_cache_get_new_uids): * camel-url.c (camel_url_new_with_base): Plug leaks. * camel-remote-store.c (camel_remote_store_init): Don't re-initialize the folders hash table. * providers/imap/camel-imap-store.c (imap_disconnect): Free authtypes since they'll be re-read on re-connect. (get_folder_info): Free folderinfos that we're discarding from the list. svn path=/trunk/; revision=9302
Diffstat (limited to 'camel/camel-object.c')
-rw-r--r--camel/camel-object.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/camel/camel-object.c b/camel/camel-object.c
index 53e7069653..bdb17fa177 100644
--- a/camel/camel-object.c
+++ b/camel/camel-object.c
@@ -690,6 +690,7 @@ camel_object_hook_event (CamelObject * obj, const gchar * name,
{
GSList *hooklist;
CamelHookPair *pair;
+ gpointer old_name, old_hooklist;
g_return_if_fail (CAMEL_IS_OBJECT (obj));
g_return_if_fail (name);
@@ -703,10 +704,16 @@ camel_object_hook_event (CamelObject * obj, const gchar * name,
pair->func = hook;
pair->user_data = user_data;
- hooklist = g_hash_table_lookup (obj->event_to_hooklist, name);
- hooklist = g_slist_prepend (hooklist, pair);
- g_hash_table_insert (obj->event_to_hooklist, g_strdup (name),
- hooklist);
+ if (g_hash_table_lookup_extended (obj->event_to_hooklist, name,
+ &old_name, &old_hooklist)) {
+ hooklist = g_slist_prepend (old_hooklist, pair);
+ g_hash_table_insert (obj->event_to_hooklist, old_name,
+ hooklist);
+ } else {
+ hooklist = g_slist_prepend (NULL, pair);
+ g_hash_table_insert (obj->event_to_hooklist, g_strdup (name),
+ hooklist);
+ }
}
void