gtk-demo: Fix a few crash

The paintable demos were forgetting to clear
their window variable.
This commit is contained in:
Matthias Clasen 2020-09-11 21:05:09 -04:00
parent e55bdf87b5
commit 2679e29375
2 changed files with 2 additions and 0 deletions

View File

@ -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);

View File

@ -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);