Don't leak a ref to the settings

https://bugzilla.gnome.org/show_bug.cgi?id=683896
This commit is contained in:
William Jon McCann
2012-09-12 09:08:28 -04:00
committed by Matthias Clasen
parent 1f5dea9eba
commit 8a9a3949dd
3 changed files with 27 additions and 1 deletions

View File

@ -2091,7 +2091,7 @@ gtk_toolbar_screen_changed (GtkWidget *widget,
if (old_settings)
{
g_signal_handler_disconnect (old_settings, priv->settings_connection);
priv->settings_connection = 0;
g_object_unref (old_settings);
}
@ -3122,6 +3122,14 @@ gtk_toolbar_dispose (GObject *object)
priv->menu = NULL;
}
if (priv->settings_connection > 0)
{
g_signal_handler_disconnect (priv->settings, priv->settings_connection);
priv->settings_connection = 0;
}
g_clear_object (&priv->settings);
G_OBJECT_CLASS (gtk_toolbar_parent_class)->dispose (object);
}