[evolution] I#1389 - Contacts: Crash when adding contacts into Contact List



commit e69fc382960a658bdd8b8d5c3613a9695a648c8b
Author: Milan Crha <mcrha redhat com>
Date:   Thu Mar 11 09:48:27 2021 +0100

    I#1389 - Contacts: Crash when adding contacts into Contact List
    
    Closes https://gitlab.gnome.org/GNOME/evolution/-/issues/1389

 src/addressbook/gui/contact-list-editor/e-contact-list-editor.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
---
diff --git a/src/addressbook/gui/contact-list-editor/e-contact-list-editor.c 
b/src/addressbook/gui/contact-list-editor/e-contact-list-editor.c
index 04f2bdc0e6..b8b6808634 100644
--- a/src/addressbook/gui/contact-list-editor/e-contact-list-editor.c
+++ b/src/addressbook/gui/contact-list-editor/e-contact-list-editor.c
@@ -535,6 +535,9 @@ contact_list_editor_add_from_email_entry (EContactListEditor *editor,
        store = e_name_selector_entry_peek_destination_store (entry);
        dests = e_destination_store_list_destinations (store);
 
+       /* Add a reference, to not have it freed in e-name-selector-entry.c::user_focus_out() */
+       g_list_foreach (dests, (GFunc) g_object_ref, NULL);
+
        for (diter = dests; diter; diter = g_list_next (diter)) {
                EDestination *dest = diter->data;
 
@@ -545,7 +548,7 @@ contact_list_editor_add_from_email_entry (EContactListEditor *editor,
                }
        }
 
-       g_list_free (dests);
+       g_list_free_full (dests, g_object_unref);
 
        if (!added)
                contact_list_editor_add_email (editor, gtk_entry_get_text (GTK_ENTRY (entry)));


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]