[devhelp/wip/swilmet/misc-improvements: 10/10] sidebar: dispose() before finalize()



commit 54217a324628fda9fd0b16ddd52f17ceda06f428
Author: Sébastien Wilmet <swilmet gnome org>
Date:   Sun May 24 17:19:37 2015 +0200

    sidebar: dispose() before finalize()
    
    So that the code can be read in the logical order.

 src/dh-sidebar.c |   14 +++++++-------
 1 files changed, 7 insertions(+), 7 deletions(-)
---
diff --git a/src/dh-sidebar.c b/src/dh-sidebar.c
index 5ad1a7e..df4e8a5 100644
--- a/src/dh-sidebar.c
+++ b/src/dh-sidebar.c
@@ -457,23 +457,23 @@ dh_sidebar_new (DhBookManager *book_manager)
 }
 
 static void
-dh_sidebar_finalize (GObject *object)
+dh_sidebar_dispose (GObject *object)
 {
         DhSidebarPrivate *priv = dh_sidebar_get_instance_private (DH_SIDEBAR (object));
 
-        g_completion_free (priv->completion);
+        g_clear_object (&priv->book_manager);
 
-        G_OBJECT_CLASS (dh_sidebar_parent_class)->finalize (object);
+        G_OBJECT_CLASS (dh_sidebar_parent_class)->dispose (object);
 }
 
 static void
-dh_sidebar_dispose (GObject *object)
+dh_sidebar_finalize (GObject *object)
 {
         DhSidebarPrivate *priv = dh_sidebar_get_instance_private (DH_SIDEBAR (object));
 
-        g_clear_object (&priv->book_manager);
+        g_completion_free (priv->completion);
 
-        G_OBJECT_CLASS (dh_sidebar_parent_class)->dispose (object);
+        G_OBJECT_CLASS (dh_sidebar_parent_class)->finalize (object);
 }
 
 static void
@@ -635,8 +635,8 @@ dh_sidebar_class_init (DhSidebarClass *klass)
 {
         GObjectClass *object_class = G_OBJECT_CLASS (klass);
 
-        object_class->finalize = dh_sidebar_finalize;
         object_class->dispose = dh_sidebar_dispose;
+        object_class->finalize = dh_sidebar_finalize;
         object_class->get_property = dh_sidebar_get_property;
         object_class->set_property = dh_sidebar_set_property;
         object_class->constructed = dh_sidebar_constructed;


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