Check that local_listener and other_contacts_listener are non-NULL before

2001-10-31  Jon Trowbridge  <trow@ximian.com>

	* 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
This commit is contained in:
Jon Trowbridge
2001-10-31 06:44:00 +00:00
committed by Jon Trowbridge
parent 0051272a4e
commit a419fc54e6
4 changed files with 31 additions and 14 deletions

View File

@ -1,3 +1,20 @@
2001-10-31 Jon Trowbridge <trow@ximian.com>
* 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.
2001-10-30 Jon Trowbridge <trow@ximian.com>
* gui/component/select-names/e-select-names-bonobo.c
@ -1014,7 +1031,7 @@
gui/widgets/e-minicard.c (remodel): Fixed these to determine the
fields to use properly.
2001-10-02 Jon Trowbridge <trow@gnu.org>
2001-10-02 Jon Trowbridge <trow@ximian.com>
* gui/component/select-names/e-select-names-completion.c
(name_style_query): Strip out commas before forming our query.

View File

@ -356,13 +356,6 @@ impl_destroy (GtkObject *object)
select_names = E_SELECT_NAMES_BONOBO (object);
priv = select_names->priv;
/* FIXME: a hack to work around some ref counting brokenness that
I'll fix later. */
if (priv->manager->names) {
gtk_widget_destroy (GTK_WIDGET (priv->manager->names));
priv->manager->names = NULL;
}
gtk_object_unref (GTK_OBJECT (priv->manager));

View File

@ -394,7 +394,6 @@ entry_destroyed(EEntry *entry, ESelectNamesManager *manager)
}
}
}
gtk_object_unref(GTK_OBJECT(manager));
}
static void
@ -502,6 +501,8 @@ e_select_names_manager_create_entry (ESelectNamesManager *manager, const char *i
entry->entry = eentry;
entry->id = (char *)id;
gtk_object_ref (GTK_OBJECT (entry->entry));
model = e_select_names_text_model_new (section->model);
e_list_append (manager->entries, entry);
g_free(entry);
@ -520,9 +521,10 @@ e_select_names_manager_create_entry (ESelectNamesManager *manager, const char *i
"use_ellipsis", TRUE,
"allow_newlines", FALSE,
NULL);
gtk_signal_connect(GTK_OBJECT(eentry), "destroy",
GTK_SIGNAL_FUNC(entry_destroyed), manager);
gtk_object_ref(GTK_OBJECT(manager));
return GTK_WIDGET(eentry);
}
}

View File

@ -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);