[Xfce4-commits] <thunar:master> Unset the list model folder in dispose.

Nick Schermer noreply at xfce.org
Sun Nov 11 01:36:09 CET 2012


Updating branch refs/heads/master
         to 6cadc76021a81c4d7508230b961b5b19bfc90519 (commit)
       from b3d91bb72fbab55e8652cfe1eece2c976d326ee1 (commit)

commit 6cadc76021a81c4d7508230b961b5b19bfc90519
Author: Nick Schermer <nick at xfce.org>
Date:   Sun Nov 11 01:01:55 2012 +0100

    Unset the list model folder in dispose.
    
    pspecs are already freed in finalize.

 thunar/thunar-list-model.c |   16 +++++++++++++---
 1 files changed, 13 insertions(+), 3 deletions(-)

diff --git a/thunar/thunar-list-model.c b/thunar/thunar-list-model.c
index e404193..6126329 100644
--- a/thunar/thunar-list-model.c
+++ b/thunar/thunar-list-model.c
@@ -70,6 +70,7 @@ typedef gint (*ThunarSortFunc) (const ThunarFile *a,
 static void               thunar_list_model_tree_model_init       (GtkTreeModelIface      *iface);
 static void               thunar_list_model_drag_dest_init        (GtkTreeDragDestIface   *iface);
 static void               thunar_list_model_sortable_init         (GtkTreeSortableIface   *iface);
+static void               thunar_list_model_dispose               (GObject                *object);
 static void               thunar_list_model_finalize              (GObject                *object);
 static void               thunar_list_model_get_property          (GObject                *object,
                                                                    guint                   prop_id,
@@ -248,6 +249,7 @@ thunar_list_model_class_init (ThunarListModelClass *klass)
   GObjectClass *gobject_class;
 
   gobject_class               = G_OBJECT_CLASS (klass);
+  gobject_class->dispose      = thunar_list_model_dispose;
   gobject_class->finalize     = thunar_list_model_finalize;
   gobject_class->get_property = thunar_list_model_get_property;
   gobject_class->set_property = thunar_list_model_set_property;
@@ -416,13 +418,21 @@ thunar_list_model_init (ThunarListModel *store)
 
 
 static void
+thunar_list_model_dispose (GObject *object)
+{
+  /* unlink from the folder (if any) */
+  thunar_list_model_set_folder (THUNAR_LIST_MODEL (object), NULL);
+
+  (*G_OBJECT_CLASS (thunar_list_model_parent_class)->dispose) (object);
+}
+
+
+
+static void
 thunar_list_model_finalize (GObject *object)
 {
   ThunarListModel *store = THUNAR_LIST_MODEL (object);
 
-  /* unlink from the folder (if any) */
-  thunar_list_model_set_folder (store, NULL);
-
   g_sequence_free (store->rows);
 
   /* disconnect from the file monitor */


More information about the Xfce4-commits mailing list