From f329f501c9da08b8a85feb939593732167d27847 Mon Sep 17 00:00:00 2001 From: Carlos Soriano Date: Thu, 8 Oct 2015 10:51:27 +0200 Subject: toolbar: use finalize instead of dispose We were disconnecting all the signals on dispose, except the ones that comes from the widgets and are added with gtk_widget_class_bind_template_callback. Therefore those can be emitted after a dispose. In the toolbar case, we connect to the toggle signal of a button, which when the toolbar gets disposed, the buttons gets untoggled and the signal is emitted, then the toolbar tries to perform actions on external data that was cleared already on dispose. To avoid that, just clear the data on finalize instead of dispose. --- src/nautilus-toolbar.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/nautilus-toolbar.c b/src/nautilus-toolbar.c index 21fcbe785..cd048b004 100644 --- a/src/nautilus-toolbar.c +++ b/src/nautilus-toolbar.c @@ -804,7 +804,7 @@ nautilus_toolbar_set_property (GObject *object, } static void -nautilus_toolbar_dispose (GObject *obj) +nautilus_toolbar_finalize (GObject *obj) { NautilusToolbar *self = NAUTILUS_TOOLBAR (obj); @@ -819,7 +819,7 @@ nautilus_toolbar_dispose (GObject *obj) g_signal_handlers_disconnect_by_data (self->priv->progress_manager, self); g_clear_object (&self->priv->progress_manager); - G_OBJECT_CLASS (nautilus_toolbar_parent_class)->dispose (obj); + G_OBJECT_CLASS (nautilus_toolbar_parent_class)->finalize (obj); } static void @@ -832,7 +832,7 @@ nautilus_toolbar_class_init (NautilusToolbarClass *klass) oclass = G_OBJECT_CLASS (klass); oclass->get_property = nautilus_toolbar_get_property; oclass->set_property = nautilus_toolbar_set_property; - oclass->dispose = nautilus_toolbar_dispose; + oclass->finalize = nautilus_toolbar_finalize; properties[PROP_WINDOW] = g_param_spec_object ("window", -- cgit v1.2.1