Commit f329f501 authored by Carlos Soriano Sánchez's avatar Carlos Soriano Sánchez
Browse files

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
parent 940d6d7b
......@@ -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",
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment