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 --- .../gui/component/select-names/e-select-names-model.c | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) (limited to 'addressbook/gui/component/select-names/e-select-names-model.c') diff --git a/addressbook/gui/component/select-names/e-select-names-model.c b/addressbook/gui/component/select-names/e-select-names-model.c index 6c31e1baf7..65ae293174 100644 --- a/addressbook/gui/component/select-names/e-select-names-model.c +++ b/addressbook/gui/component/select-names/e-select-names-model.c @@ -61,6 +61,7 @@ struct _ESelectNamesModelPrivate { gboolean pending_changed; }; +static GObjectClass *parent_class = NULL; static void e_select_names_model_init (ESelectNamesModel *model); static void e_select_names_model_class_init (ESelectNamesModelClass *klass); @@ -97,6 +98,7 @@ e_select_names_model_class_init (ESelectNamesModelClass *klass) GObjectClass *object_class; object_class = G_OBJECT_CLASS(klass); + parent_class = g_type_class_peek_parent (klass); e_select_names_model_signals[E_SELECT_NAMES_MODEL_CHANGED] = g_signal_new ("changed", @@ -139,15 +141,20 @@ static void e_select_names_model_dispose (GObject *object) { ESelectNamesModel *model = E_SELECT_NAMES_MODEL (object); - - g_free (model->priv->title); - g_free (model->priv->id); - g_list_foreach (model->priv->data, (GFunc) g_object_unref, NULL); - g_list_free (model->priv->data); + if (model->priv) { + g_free (model->priv->title); + g_free (model->priv->id); - g_free (model->priv); + g_list_foreach (model->priv->data, (GFunc) g_object_unref, NULL); + g_list_free (model->priv->data); + + g_free (model->priv); + model->priv = NULL; + } + if (G_OBJECT_CLASS (parent_class)->dispose) + G_OBJECT_CLASS (parent_class)->dispose (object); } -- cgit v1.2.3