From bb8ba48a852db03fd1575a2132a6c9413de069c8 Mon Sep 17 00:00:00 2001 From: Christopher James Lahey Date: Wed, 3 Jan 2001 04:05:06 +0000 Subject: Make sure this won't crash if the given contact is removed from the 2001-01-02 Christopher James Lahey * contact-editor/e-contact-editor.c (delete_cb): Make sure this won't crash if the given contact is removed from the database while this function is being called. * gui/widgets/e-minicard.c: Made sure this won't crash if the given contact is removed from the database while the right click menu is being displayed. svn path=/trunk/; revision=7227 --- addressbook/contact-editor/e-contact-editor.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'addressbook/contact-editor') diff --git a/addressbook/contact-editor/e-contact-editor.c b/addressbook/contact-editor/e-contact-editor.c index bc8574e66a..125ab38767 100644 --- a/addressbook/contact-editor/e-contact-editor.c +++ b/addressbook/contact-editor/e-contact-editor.c @@ -716,18 +716,26 @@ static void delete_cb (GtkWidget *widget, gpointer data) { EContactEditor *ce = E_CONTACT_EDITOR (data); + ECard *card = ce->card; + ECardSimple *simple = ce->simple; + + gtk_object_ref(GTK_OBJECT(card)); + gtk_object_ref(GTK_OBJECT(simple)); if (e_contact_editor_confirm_delete(GTK_WINDOW(ce->app))) { extract_info (ce); - e_card_simple_sync_card (ce->simple); + e_card_simple_sync_card (simple); if (!ce->is_new_card) gtk_signal_emit (GTK_OBJECT (ce), contact_editor_signals[DELETE_CARD], - ce->card); + card); file_close_cb(widget, data); } + + gtk_object_unref(GTK_OBJECT(card)); + gtk_object_unref(GTK_OBJECT(simple)); } /* Emits the signal to request printing a card */ -- cgit v1.2.3