From 04c3c659f5fc337586cf1f5608fd809b9cf73ac2 Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Thu, 6 Aug 2020 21:13:39 -0400 Subject: [PATCH 1/2] gtk-demo: Plug a small memory leak The settings demo was leaking a GtkBuilderScope. --- demos/gtk-demo/listview_settings.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/demos/gtk-demo/listview_settings.c b/demos/gtk-demo/listview_settings.c index 03ed9642e4..3bb674117b 100644 --- a/demos/gtk-demo/listview_settings.c +++ b/demos/gtk-demo/listview_settings.c @@ -358,6 +358,8 @@ do_listview_settings (GtkWidget *do_widget) builder = gtk_builder_new (); gtk_builder_set_scope (builder, scope); + g_object_unref (scope); + gtk_builder_add_from_resource (builder, "/listview_settings/listview_settings.ui", NULL); window = GTK_WIDGET (gtk_builder_get_object (builder, "window")); From 14900efe38a090b96d0f6a8bc2ad16ecca71e132 Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Thu, 6 Aug 2020 21:14:11 -0400 Subject: [PATCH 2/2] gtk-demo: Plug a big memory leak The colors demo was leaking all its colors. Oops. --- demos/gtk-demo/listview_colors.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/demos/gtk-demo/listview_colors.c b/demos/gtk-demo/listview_colors.c index f809b73c1b..b63f2366e0 100644 --- a/demos/gtk-demo/listview_colors.c +++ b/demos/gtk-demo/listview_colors.c @@ -226,7 +226,7 @@ gtk_color_set_property (GObject *object, break; case PROP_COLOR: - self->color = *(GdkRGBA *) g_value_dup_boxed (value); + self->color = *(GdkRGBA *) g_value_get_boxed (value); rgb_to_hsv (&self->color, &h, &s, &v); self->h = round (360 * h); self->s = round (100 * s);