diff options
Diffstat (limited to 'addressbook')
-rw-r--r-- | addressbook/ChangeLog | 7 | ||||
-rw-r--r-- | addressbook/importers/evolution-ldif-importer.c | 12 |
2 files changed, 11 insertions, 8 deletions
diff --git a/addressbook/ChangeLog b/addressbook/ChangeLog index e7342e4e02..7f6ca320ad 100644 --- a/addressbook/ChangeLog +++ b/addressbook/ChangeLog @@ -1,3 +1,10 @@ +2007-10-02 Matthew Barnes <mbarnes@redhat.com> + + ** Fixes part of bug #469657 + + * importers/evolution-ldif-importer.c: + Use destroy functions in GHashTables to simplify memory management. + 2007-10-01 Milan Crha <mcrha@redhat.com> ** Fix for bug #337539 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 @@ -576,12 +576,6 @@ ldif_supported(EImport *ei, EImportTarget *target, EImportImporter *im) } static void -free_dn_hash(void *k, void *v, void *d) -{ - g_free(k); -} - -static void ldif_import_done(LDIFImporter *gci) { if (gci->idle_id) @@ -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); |