aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--addressbook/ChangeLog9
-rw-r--r--addressbook/gui/merging/e-card-merging.c19
2 files changed, 21 insertions, 7 deletions
diff --git a/addressbook/ChangeLog b/addressbook/ChangeLog
index 64d6f61c90..c5d64f58d2 100644
--- a/addressbook/ChangeLog
+++ b/addressbook/ChangeLog
@@ -1,3 +1,12 @@
+2003-05-15 Chris Toshok <toshok@ximian.com>
+
+ * gui/merging/e-card-merging.c (free_lookup): new function, split
+ out the duplicated teardown code from final_cb and final_id_cb.
+ also, unref the card.
+ (final_id_cb): call free_lookup.
+ (final_cb): same.
+ (e_card_merging_book_add_card): ref the card. fixes bug #43016.
+
2003-05-14 Chris Toshok <toshok@ximian.com>
* gui/contact-editor/e-contact-editor.c (full_addr_clicked):
diff --git a/addressbook/gui/merging/e-card-merging.c b/addressbook/gui/merging/e-card-merging.c
index 3de0a02a6d..3577fd41b5 100644
--- a/addressbook/gui/merging/e-card-merging.c
+++ b/addressbook/gui/merging/e-card-merging.c
@@ -31,6 +31,15 @@ typedef struct {
} ECardMergingLookup;
static void
+free_lookup (ECardMergingLookup *lookup)
+{
+ g_object_unref (lookup->book);
+ g_object_unref (lookup->card);
+
+ g_free (lookup);
+}
+
+static void
final_id_cb (EBook *book, EBookStatus status, const char *id, gpointer closure)
{
ECardMergingLookup *lookup = closure;
@@ -38,9 +47,7 @@ final_id_cb (EBook *book, EBookStatus status, const char *id, gpointer closure)
if (lookup->id_cb)
lookup->id_cb (lookup->book, status, id, lookup->closure);
- g_object_unref (lookup->book);
-
- g_free (lookup);
+ free_lookup (lookup);
}
static void
@@ -51,9 +58,7 @@ final_cb (EBook *book, EBookStatus status, gpointer closure)
if (lookup->cb)
lookup->cb (lookup->book, status, lookup->closure);
- g_object_unref (lookup->book);
-
- g_free (lookup);
+ free_lookup (lookup);
}
static void
@@ -144,7 +149,7 @@ e_card_merging_book_add_card (EBook *book,
lookup->op = E_CARD_MERGING_ADD;
lookup->book = g_object_ref (book);
- lookup->card = card;
+ lookup->card = g_object_ref (card);
lookup->id_cb = cb;
lookup->closure = closure;