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/importers/elm-importer.c | |
parent | 79521efaeecfbaf717e465670fcd2724aea53578 (diff) | |
download | gsoc2013-evolution-09d4af6fff63dd112b8bb42087f14f7018e2f78c.tar.gz 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/importers/elm-importer.c')
-rw-r--r-- | mail/importers/elm-importer.c | 22 |
1 files changed, 7 insertions, 15 deletions
diff --git a/mail/importers/elm-importer.c b/mail/importers/elm-importer.c index 1204c0d09e..ca4b18bdf5 100644 --- a/mail/importers/elm-importer.c +++ b/mail/importers/elm-importer.c @@ -68,7 +68,12 @@ parse_elm_rc(const char *elmrc) { char line[4096]; FILE *handle; - GHashTable *prefs = g_hash_table_new(g_str_hash, g_str_equal); + GHashTable *prefs; + + prefs = g_hash_table_new_full ( + g_str_hash, g_str_equal, + (GDestroyNotify) g_free, + (GDestroyNotify) g_free); if (!g_file_test(elmrc, G_FILE_TEST_IS_REGULAR)) return prefs; @@ -119,19 +124,6 @@ parse_elm_rc(const char *elmrc) return prefs; } -static void -elm_free_rc_item(void *k, void *v, void *d) -{ - g_free(k); - g_free(v); -} - -static void -elm_free_rc(void *prefs) -{ - g_hash_table_foreach(prefs, elm_free_rc_item, NULL); -} - static char * elm_get_rc(EImport *ei, const char *name) { @@ -143,7 +135,7 @@ elm_get_rc(EImport *ei, const char *name) elmrc = g_build_filename(g_get_home_dir(), ".elm/elmrc", NULL); prefs = parse_elm_rc(elmrc); g_free(elmrc); - g_object_set_data_full((GObject *)ei, "elm-rc", prefs, elm_free_rc); + g_object_set_data((GObject *)ei, "elm-rc", prefs); } if (prefs == NULL) |