From d86bef7867f188232ae98a712c0c47760b9ebad3 Mon Sep 17 00:00:00 2001 From: Carlos Soriano Date: Wed, 13 Jan 2016 18:44:04 +0100 Subject: 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 file changed, 1 insertion(+), 12 deletions(-) diff --git a/src/nautilus-files-view.c b/src/nautilus-files-view.c index 6fa737d16..b2a6de1e8 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); @@ -7958,7 +7948,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; -- cgit v1.2.1