[gtk/emblem-demo: 1/3] gtk-demo: Fix a few crash
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/emblem-demo: 1/3] gtk-demo: Fix a few crash
- Date: Sat, 12 Sep 2020 01:11:35 +0000 (UTC)
commit 2679e29375ef263fc0d84d7f4e63f3fb4689f88a
Author: Matthias Clasen <mclasen redhat com>
Date: Fri Sep 11 21:05:09 2020 -0400
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);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]