diff options
author | Matthew Barnes <mbarnes@redhat.com> | 2007-10-02 19:54:42 +0800 |
---|---|---|
committer | Matthew Barnes <mbarnes@src.gnome.org> | 2007-10-02 19:54:42 +0800 |
commit | 09d4af6fff63dd112b8bb42087f14f7018e2f78c (patch) | |
tree | 991537a9ea1d8487334f6fb299098daf425f9db8 /mail/mail-component.c | |
parent | 79521efaeecfbaf717e465670fcd2724aea53578 (diff) | |
download | gsoc2013-evolution-09d4af6fff63dd112b8bb42087f14f7018e2f78c.tar gsoc2013-evolution-09d4af6fff63dd112b8bb42087f14f7018e2f78c.tar.gz gsoc2013-evolution-09d4af6fff63dd112b8bb42087f14f7018e2f78c.tar.bz2 gsoc2013-evolution-09d4af6fff63dd112b8bb42087f14f7018e2f78c.tar.lz gsoc2013-evolution-09d4af6fff63dd112b8bb42087f14f7018e2f78c.tar.xz gsoc2013-evolution-09d4af6fff63dd112b8bb42087f14f7018e2f78c.tar.zst gsoc2013-evolution-09d4af6fff63dd112b8bb42087f14f7018e2f78c.zip |
** Fixes bug #469657
2007-10-02 Matthew Barnes <mbarnes@redhat.com>
** Fixes bug #469657
* addressbook/importers/evolution-ldif-importer.c:
* calendar/gui/comp-editor-factory.c:
* composer/e-msg-composer.c:
* e-util/e-config-listener.c:
* mail/em-composer-prefs.c:
* mail/em-folder-tree-model.c:
* mail/em-format.c:
* mail/em-format-html.c:
* mail/em-migrate.c:
* mail/em-subscribe-editor.c:
* mail/mail-component.c:
* mail/mail-send-recv.c:
* mail/message-list.c:
* mail/importers/elm-importer.c:
* plugins/exchange-operations/exchange-folder-size-display.c:
* plugins/mono/mono-plugin.c:
* shell/e-shell-settings-dialog.c:
* tools/killev.c:
* widgets/table/e-table-extras.c:
* widgets/table/e-table-selection-model.c:
Use destroy functions in GHashTables to simplify memory management.
svn path=/trunk/; revision=34344
Diffstat (limited to 'mail/mail-component.c')
-rw-r--r-- | mail/mail-component.c | 25 |
1 files changed, 12 insertions, 13 deletions
diff --git a/mail/mail-component.c b/mail/mail-component.c index c27fee6250..2aa9274b30 100644 --- a/mail/mail-component.c +++ b/mail/mail-component.c @@ -460,13 +460,6 @@ impl_dispose (GObject *object) } static void -store_hash_free (CamelStore *store, struct _store_info *si, void *data) -{ - si->removed = 1; - store_info_unref(si); -} - -static void impl_finalize (GObject *object) { MailComponentPrivate *priv = MAIL_COMPONENT (object)->priv; @@ -475,7 +468,6 @@ impl_finalize (GObject *object) mail_async_event_destroy (priv->async_event); - g_hash_table_foreach (priv->store_hash, (GHFunc)store_hash_free, NULL); g_hash_table_destroy (priv->store_hash); if (mail_async_event_destroy (priv->async_event) == -1) { @@ -1172,6 +1164,13 @@ mail_component_class_init (MailComponentClass *class) } static void +store_hash_free (struct _store_info *si) +{ + si->removed = 1; + store_info_unref(si); +} + +static void mail_component_init (MailComponent *component) { MailComponentPrivate *priv; @@ -1200,7 +1199,10 @@ mail_component_init (MailComponent *component) mail_session_init (priv->base_directory); priv->async_event = mail_async_event_new(); - priv->store_hash = g_hash_table_new (NULL, NULL); + priv->store_hash = g_hash_table_new_full ( + NULL, NULL, + (GDestroyNotify) NULL, + (GDestroyNotify) store_hash_free); mail_autoreceive_init(); } @@ -1319,7 +1321,6 @@ void mail_component_remove_store (MailComponent *component, CamelStore *store) { MailComponentPrivate *priv; - struct _store_info *si; MAIL_COMPONENT_DEFAULT(component); @@ -1331,13 +1332,11 @@ mail_component_remove_store (MailComponent *component, CamelStore *store) * URL will always return the same object. So this works. */ - if (!(si = g_hash_table_lookup (priv->store_hash, store))) + if (g_hash_table_lookup (priv->store_hash, store) == NULL) return; camel_object_ref (store); g_hash_table_remove (priv->store_hash, store); - si->removed = 1; - store_info_unref(si); /* so i guess potentially we could have a race, add a store while one being removed. ?? */ |