From 2679e29375ef263fc0d84d7f4e63f3fb4689f88a Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Fri, 11 Sep 2020 21:05:09 -0400 Subject: [PATCH] gtk-demo: Fix a few crash The paintable demos were forgetting to clear their window variable. --- demos/gtk-demo/paintable.c | 1 + demos/gtk-demo/paintable_animated.c | 1 + 2 files changed, 2 insertions(+) diff --git a/demos/gtk-demo/paintable.c b/demos/gtk-demo/paintable.c index 982697ed7c..3b3da1e0bc 100644 --- a/demos/gtk-demo/paintable.c +++ b/demos/gtk-demo/paintable.c @@ -161,6 +161,7 @@ do_paintable (GtkWidget *do_widget) gtk_widget_get_display (do_widget)); gtk_window_set_title (GTK_WINDOW (window), "Nuclear Icon"); gtk_window_set_default_size (GTK_WINDOW (window), 300, 200); + g_object_add_weak_pointer (G_OBJECT (window), (gpointer *)&window); nuclear = gtk_nuclear_icon_new (0.0); image = gtk_image_new_from_paintable (nuclear); diff --git a/demos/gtk-demo/paintable_animated.c b/demos/gtk-demo/paintable_animated.c index f7571c08b2..17b1372d98 100644 --- a/demos/gtk-demo/paintable_animated.c +++ b/demos/gtk-demo/paintable_animated.c @@ -193,6 +193,7 @@ do_paintable_animated (GtkWidget *do_widget) gtk_widget_get_display (do_widget)); gtk_window_set_title (GTK_WINDOW (window), "Nuclear Animation"); gtk_window_set_default_size (GTK_WINDOW (window), 300, 200); + g_object_add_weak_pointer (G_OBJECT (window), (gpointer *)&window); nuclear = gtk_nuclear_animation_new (); image = gtk_image_new_from_paintable (nuclear);