summaryrefslogtreecommitdiff
path: root/gtk/gtktoolbar.c
diff options
context:
space:
mode:
authorWilliam Jon McCann <jmccann@redhat.com>2012-09-12 09:08:28 -0400
committerMatthias Clasen <mclasen@redhat.com>2012-09-16 20:21:06 -0400
commit8a9a3949ddb4238444339426c9a82412299f2b83 (patch)
tree9ddaac28a8b27e8b2a1bf3cae2e46de50db204bb /gtk/gtktoolbar.c
parent1f5dea9eba4de5a54e9370fe8e4b90e6c0cec200 (diff)
downloadgtk+-8a9a3949ddb4238444339426c9a82412299f2b83.tar.gz
Don't leak a ref to the settings
https://bugzilla.gnome.org/show_bug.cgi?id=683896
Diffstat (limited to 'gtk/gtktoolbar.c')
-rw-r--r--gtk/gtktoolbar.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/gtk/gtktoolbar.c b/gtk/gtktoolbar.c
index 69fd2b3e51..e184c067f2 100644
--- a/gtk/gtktoolbar.c
+++ b/gtk/gtktoolbar.c
@@ -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);
}