summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarlos Soriano <csoriano@gnome.org>2015-10-08 10:51:27 +0200
committerCarlos Soriano <csoriano@gnome.org>2015-10-08 10:51:27 +0200
commitf329f501c9da08b8a85feb939593732167d27847 (patch)
treef1dd114971b25a13cdfdddbe73b5776ddf6afbfc
parent940d6d7b6d2c7ff49e55d6ec7af4c5ff73687d02 (diff)
downloadnautilus-f329f501c9da08b8a85feb939593732167d27847.tar.gz
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.
-rw-r--r--src/nautilus-toolbar.c6
1 files 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",