From 09d4af6fff63dd112b8bb42087f14f7018e2f78c Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Tue, 2 Oct 2007 11:54:42 +0000 Subject: ** Fixes bug #469657 2007-10-02 Matthew Barnes ** 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 --- addressbook/importers/evolution-ldif-importer.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'addressbook/importers/evolution-ldif-importer.c') diff --git a/addressbook/importers/evolution-ldif-importer.c b/addressbook/importers/evolution-ldif-importer.c index 5080557c17..1e055db4da 100644 --- a/addressbook/importers/evolution-ldif-importer.c +++ b/addressbook/importers/evolution-ldif-importer.c @@ -575,12 +575,6 @@ ldif_supported(EImport *ei, EImportTarget *target, EImportImporter *im) return FALSE; } -static void -free_dn_hash(void *k, void *v, void *d) -{ - g_free(k); -} - static void ldif_import_done(LDIFImporter *gci) { @@ -593,7 +587,6 @@ ldif_import_done(LDIFImporter *gci) g_slist_foreach(gci->list_contacts, (GFunc) g_object_unref, NULL); g_slist_free(gci->contacts); g_slist_free(gci->list_contacts); - g_hash_table_foreach(gci->dn_contact_hash, free_dn_hash, NULL); g_hash_table_destroy(gci->dn_contact_hash); e_import_complete(gci->import, gci->target); @@ -639,7 +632,10 @@ ldif_import(EImport *ei, EImportTarget *target, EImportImporter *im) fseek(file, 0, SEEK_END); gci->size = ftell(file); fseek(file, 0, SEEK_SET); - gci->dn_contact_hash = g_hash_table_new(g_str_hash, g_str_equal); + gci->dn_contact_hash = g_hash_table_new_full ( + g_str_hash, g_str_equal, + (GDestroyNotify) g_free, + (GDestroyNotify) NULL); e_book_open(gci->book, FALSE, NULL); -- cgit v1.2.3