diff options
author | Carlos Soriano <csoriano@gnome.org> | 2015-11-26 17:31:27 +0100 |
---|---|---|
committer | Carlos Soriano <csoriano@gnome.org> | 2015-11-26 17:44:17 +0100 |
commit | 347369d18eb6c89217573453c1eacd0a5df1e54a (patch) | |
tree | bbd410343b665548212a1084ce2500845f417cf3 | |
parent | 7b0ba20f4bab5ef35988c541d3f98537347ef831 (diff) | |
download | nautilus-347369d18eb6c89217573453c1eacd0a5df1e54a.tar.gz |
files-view: unref action group
We were leaking it, causing that the view was not free if
there were some templates, since templates menu items were
holding a ref to the view and are only freed when the closure
of the action gets freed, which is the view action group.
This was making the view to get never finalized, and therefore
making all kind of problems afterwards.
Upcoming patch will also make template not hold a ref to the view,
even if the issue is fixed now, I think templates menu items holding
a reference to the view is wrong.
-rw-r--r-- | src/nautilus-files-view.c | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/src/nautilus-files-view.c b/src/nautilus-files-view.c index 415e55418..d17bb83bf 100644 --- a/src/nautilus-files-view.c +++ b/src/nautilus-files-view.c @@ -2879,7 +2879,7 @@ nautilus_files_view_destroy (GtkWidget *object) } static void -nautilus_files_view_finalize (GObject *object) +nautilus_files_view_dispose (GObject *object) { NautilusFilesView *view; @@ -2898,8 +2898,7 @@ nautilus_files_view_finalize (GObject *object) g_signal_handlers_disconnect_by_func (gnome_lockdown_preferences, schedule_update_context_menus, view); - - g_hash_table_destroy (view->details->non_ready_files); + g_clear_object (&view->details->view_action_group); g_clear_object (&view->details->background_menu); g_clear_object (&view->details->selection_menu); g_clear_object (&view->details->view_menu_widget); @@ -2909,6 +2908,18 @@ nautilus_files_view_finalize (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); } @@ -7848,6 +7859,7 @@ 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; |