]> git.0d.be Git - empathy.git/commitdiff
rename contact_list_store_finalize to contact_list_store_dispose
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>
Mon, 19 Oct 2009 13:26:42 +0000 (14:26 +0100)
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>
Mon, 19 Oct 2009 13:27:42 +0000 (14:27 +0100)
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

index 6d6e422bd02d539070876a773c4d385458910c5b..1ef9aef7509a3f29d5a2877d59f91937ddcaafb1 100644 (file)
@@ -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