From a419fc54e634a28acd6b6e5ca6dbed764e48c244 Mon Sep 17 00:00:00 2001 From: Jon Trowbridge Date: Wed, 31 Oct 2001 06:44:00 +0000 Subject: Check that local_listener and other_contacts_listener are non-NULL before 2001-10-31 Jon Trowbridge * gui/component/select-names/e-select-names.c (e_select_names_destroy): Check that local_listener and other_contacts_listener are non-NULL before disconnecting/unrefing. * gui/component/select-names/e-select-names-manager.c (entry_destroyed): The entry shouldn't unref the manager. (e_select_names_manager_create_entry): The entry shouldn't hold a ref to the manager. It becomes circular. (e_select_names_manager_create_entry): On the other hand, we should hold a ref to the entry we create. * gui/component/select-names/e-select-names-bonobo.c (impl_destroy): Remove the explicit dialog destroy hack. svn path=/trunk/; revision=14519 --- addressbook/gui/component/select-names/e-select-names.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'addressbook/gui/component/select-names/e-select-names.c') diff --git a/addressbook/gui/component/select-names/e-select-names.c b/addressbook/gui/component/select-names/e-select-names.c index cb04e973a6..fe737bbce7 100644 --- a/addressbook/gui/component/select-names/e-select-names.c +++ b/addressbook/gui/component/select-names/e-select-names.c @@ -657,10 +657,15 @@ e_select_names_destroy (GtkObject *object) { ESelectNames *e_select_names = E_SELECT_NAMES(object); - gtk_signal_disconnect_by_data(GTK_OBJECT(e_select_names->local_listener), e_select_names); - gtk_object_unref(GTK_OBJECT(e_select_names->local_listener)); - gtk_signal_disconnect_by_data(GTK_OBJECT(e_select_names->other_contacts_listener), e_select_names); - gtk_object_unref(GTK_OBJECT(e_select_names->other_contacts_listener)); + if (e_select_names->local_listener) { + gtk_signal_disconnect_by_data(GTK_OBJECT(e_select_names->local_listener), e_select_names); + gtk_object_unref(GTK_OBJECT(e_select_names->local_listener)); + } + + if (e_select_names->other_contacts_listener) { + gtk_signal_disconnect_by_data(GTK_OBJECT(e_select_names->other_contacts_listener), e_select_names); + gtk_object_unref(GTK_OBJECT(e_select_names->other_contacts_listener)); + } gtk_object_unref(GTK_OBJECT(e_select_names->gui)); g_hash_table_foreach(e_select_names->children, (GHFunc) e_select_names_child_free, e_select_names); -- cgit v1.2.3