From 0b1546202c75992262a3da84bcf8adf2c216022a Mon Sep 17 00:00:00 2001 From: Chris Toshok Date: Sat, 9 Nov 2002 03:11:33 +0000 Subject: parent class is GObjectClass. 2002-11-08 Chris Toshok * gui/component/select-names/e-select-names-model.h: parent class is GObjectClass. * gui/component/select-names/e-simple-card-bonobo.c (impl_dispose): guard against multiple invocations, and chain dispose. * gui/component/select-names/e-select-names.c (e_select_names_dispose): guard against multiple invocations. * gui/component/select-names/e-select-names-text-model.c (e_select_names_text_model_dispose): guard against multiple invocations. (e_select_names_text_model_set_source): fix casts. * gui/component/select-names/e-select-names-table-model.c (e_select_names_table_model_add_source): remove the GTK_OBJECT cast, fixes a warning. (clear_info): guard against multiple invocations from ::dispose. * gui/component/select-names/e-select-names-manager.c (e_select_names_manager_dispose): same. * gui/component/select-names/e-select-names-completion.c (e_select_names_completion_dispose): same. * gui/component/select-names/e-select-names-bonobo.c (impl_dispose): guard against multiple invocations. svn path=/trunk/; revision=18681 --- .../select-names/e-select-names-manager.c | 47 +++++++++++++++------- 1 file changed, 32 insertions(+), 15 deletions(-) (limited to 'addressbook/gui/component/select-names/e-select-names-manager.c') diff --git a/addressbook/gui/component/select-names/e-select-names-manager.c b/addressbook/gui/component/select-names/e-select-names-manager.c index a4d6a0c1a8..120fc25f97 100644 --- a/addressbook/gui/component/select-names/e-select-names-manager.c +++ b/addressbook/gui/component/select-names/e-select-names-manager.c @@ -38,6 +38,7 @@ enum { static guint e_select_names_manager_signals[LAST_SIGNAL] = { 0 }; +static GObjectClass *parent_class = NULL; typedef struct { char *id; @@ -60,7 +61,7 @@ typedef struct { static void e_select_names_manager_init (ESelectNamesManager *manager); static void e_select_names_manager_class_init (ESelectNamesManagerClass *klass); -static void e_select_names_manager_destroy (GtkObject *object); +static void e_select_names_manager_dispose (GObject *object); /* ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** */ @@ -605,9 +606,9 @@ e_select_names_manager_activate_dialog (ESelectNamesManager *manager, manager); g_signal_connect(manager->names, - "destroy", - G_CALLBACK(gtk_widget_destroyed), - &manager->names); + "destroy", + G_CALLBACK(gtk_widget_destroyed), + &manager->names); gtk_widget_show(GTK_WIDGET(manager->names)); } @@ -638,21 +639,36 @@ e_select_names_manager_dispose (GObject *object) manager->names = NULL; } - g_list_foreach (manager->sections, (GFunc) e_select_names_manager_section_free, NULL); - g_list_free (manager->sections); - manager->sections = NULL; + if (manager->sections) { + g_list_foreach (manager->sections, (GFunc) e_select_names_manager_section_free, NULL); + g_list_free (manager->sections); + manager->sections = NULL; + } + + if (manager->entries) { + g_list_foreach (manager->entries, (GFunc) e_select_names_manager_entry_free, NULL); + g_list_free (manager->entries); + manager->entries = NULL; + } - g_list_foreach (manager->entries, (GFunc) e_select_names_manager_entry_free, NULL); - g_list_free (manager->entries); - manager->entries = NULL; + if (manager->completion_books) { + g_list_foreach (manager->completion_books, (GFunc) g_object_unref, NULL); + g_list_free (manager->completion_books); + manager->completion_books = NULL; + } - g_list_foreach (manager->completion_books, (GFunc) g_object_unref, NULL); - g_list_free (manager->completion_books); - manager->completion_books = NULL; + if (manager->listener_id) { + g_signal_handler_disconnect (e_book_get_config_database(), manager->listener_id); + manager->listener_id = 0; + } - g_signal_handler_disconnect (e_book_get_config_database(), manager->listener_id); + if (manager->cached_folder_list) { + g_free (manager->cached_folder_list); + manager->cached_folder_list = NULL; + } - g_free (manager->cached_folder_list); + if (G_OBJECT_CLASS (parent_class)->dispose) + G_OBJECT_CLASS (parent_class)->dispose (object); } static void @@ -661,6 +677,7 @@ e_select_names_manager_class_init (ESelectNamesManagerClass *klass) GObjectClass *object_class; object_class = G_OBJECT_CLASS(klass); + parent_class = g_type_class_peek_parent (klass); object_class->dispose = e_select_names_manager_dispose; -- cgit v1.2.3