[empathy/gnome-2-28] rename contact_list_store_finalize to contact_list_store_dispose



commit aa4ffa3f6455d0dd6f12bfdde0f59f5a1485bbc3
Author: Guillaume Desmottes <guillaume desmottes collabora co uk>
Date:   Mon Oct 19 14:26:42 2009 +0100

    rename contact_list_store_finalize to contact_list_store_dispose
    
    This method just disconnect signals, release references and remove idle
    callbacks so it should really be a dispose, not a finalize.

 libempathy-gtk/empathy-contact-list-store.c |   13 +++++++++----
 1 files changed, 9 insertions(+), 4 deletions(-)
---
diff --git a/libempathy-gtk/empathy-contact-list-store.c b/libempathy-gtk/empathy-contact-list-store.c
index 6d6e422..1ef9aef 100644
--- a/libempathy-gtk/empathy-contact-list-store.c
+++ b/libempathy-gtk/empathy-contact-list-store.c
@@ -64,6 +64,7 @@ typedef struct {
 	EmpathyContactListStoreSort sort_criterium;
 	guint                       inhibit_active;
 	guint                       setup_idle_id;
+	gboolean                    dispose_has_run;
 } EmpathyContactListStorePriv;
 
 typedef struct {
@@ -84,7 +85,7 @@ typedef struct {
 	gboolean                remove;
 } ShowActiveData;
 
-static void             contact_list_store_finalize                  (GObject                       *object);
+static void             contact_list_store_dispose                  (GObject                       *object);
 static void             contact_list_store_get_property              (GObject                       *object,
 								      guint                          param_id,
 								      GValue                        *value,
@@ -216,7 +217,7 @@ empathy_contact_list_store_class_init (EmpathyContactListStoreClass *klass)
 {
 	GObjectClass *object_class = G_OBJECT_CLASS (klass);
 
-	object_class->finalize = contact_list_store_finalize;
+	object_class->dispose = contact_list_store_dispose;
 	object_class->get_property = contact_list_store_get_property;
 	object_class->set_property = contact_list_store_set_property;
 
@@ -288,11 +289,15 @@ empathy_contact_list_store_init (EmpathyContactListStore *store)
 }
 
 static void
-contact_list_store_finalize (GObject *object)
+contact_list_store_dispose (GObject *object)
 {
 	EmpathyContactListStorePriv *priv = GET_PRIV (object);
 	GList                       *contacts, *l;
 
+	if (priv->dispose_has_run)
+		return;
+	priv->dispose_has_run = TRUE;
+
 	contacts = empathy_contact_list_get_members (priv->list);
 	for (l = contacts; l; l = l->next) {
 		g_signal_handlers_disconnect_by_func (l->data,
@@ -319,7 +324,7 @@ contact_list_store_finalize (GObject *object)
 		g_source_remove (priv->setup_idle_id);
 	}
 
-	G_OBJECT_CLASS (empathy_contact_list_store_parent_class)->finalize (object);
+	G_OBJECT_CLASS (empathy_contact_list_store_parent_class)->dispose (object);
 }
 
 static void



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