[nautilus/wip/csoriano/view-slot-hateness: 1/8] files-view: use finalize instead of dispose



commit c7f3c92dd0370a3ca2858bc9d2d6aa7233328e2e
Author: Carlos Soriano <csoriano gnome org>
Date:   Wed Jan 13 18:44:04 2016 +0100

    files-view: use finalize instead of dispose
    
    Dispose is intended to let the object still valid for external
    calls.
    Freeing the action group on dispose makes the view somehow invalid,
    so some calls were made at that time and were making the view to crash.
    
    This change to dispose was made in commit 347369d18eb6 to fix a crash as
    well. However, an upcoming patch fixed it as well as noted in the
    commit message.
    So although dispose seemed good, it's not if it makes the object
    invalid.
    
    On the other hand, instead of dispose we should use destroy, since we
    are already using it, and implementing dispose was kind of an error.
    
    In upcoming patches we will move some disconnect_signal calls from
    finalized to destroy.

 src/nautilus-files-view.c |   13 +------------
 1 files changed, 1 insertions(+), 12 deletions(-)
---
diff --git a/src/nautilus-files-view.c b/src/nautilus-files-view.c
index b486fb3..02f623f 100644
--- a/src/nautilus-files-view.c
+++ b/src/nautilus-files-view.c
@@ -2909,7 +2909,7 @@ nautilus_files_view_destroy (GtkWidget *object)
 }
 
 static void
-nautilus_files_view_dispose (GObject *object)
+nautilus_files_view_finalize (GObject *object)
 {
         NautilusFilesView *view;
 
@@ -2938,16 +2938,6 @@ nautilus_files_view_dispose (GObject *object)
                                              NULL);
         }
 
-        G_OBJECT_CLASS (nautilus_files_view_parent_class)->dispose (object);
-}
-
-static void
-nautilus_files_view_finalize (GObject *object)
-{
-        NautilusFilesView *view;
-
-        view = NAUTILUS_FILES_VIEW (object);
-
         g_hash_table_destroy (view->details->non_ready_files);
 
         G_OBJECT_CLASS (nautilus_files_view_parent_class)->finalize (object);
@@ -7959,7 +7949,6 @@ nautilus_files_view_class_init (NautilusFilesViewClass *klass)
         oclass = G_OBJECT_CLASS (klass);
 
         oclass->finalize = nautilus_files_view_finalize;
-        oclass->dispose = nautilus_files_view_dispose;
         oclass->get_property = nautilus_files_view_get_property;
         oclass->set_property = nautilus_files_view_set_property;
 


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