[gnome-robots/gnome-3-14] Fix critical on game shutdown



commit 3828a1cc383de54db6c8ea079f4496de97c348ea
Author: Michael Catanzaro <mcatanzaro gnome org>
Date:   Fri Sep 11 13:01:30 2015 -0500

    Fix critical on game shutdown
    
    timeout_cb() can be called after the game area is destroyed, in which case
    an invalid game_area will be passed to gtk_widget_queue_draw() in
    clear_game_area(). Avoid that by setting game_area to NULL.

 src/gnome-robots.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
---
diff --git a/src/gnome-robots.c b/src/gnome-robots.c
index f96ef48..78578f2 100644
--- a/src/gnome-robots.c
+++ b/src/gnome-robots.c
@@ -360,6 +360,8 @@ activate (GtkApplication *app, gpointer user_data)
                    G_CALLBACK (resize_cb), NULL);
   g_signal_connect (G_OBJECT (game_area), "draw",
                    G_CALLBACK (draw_cb), NULL);
+  g_signal_connect (G_OBJECT (game_area), "destroy",
+                    G_CALLBACK (gtk_widget_destroyed), &game_area);
 
   gridframe = games_grid_frame_new (GAME_WIDTH, GAME_HEIGHT);
   gtk_container_add (GTK_CONTAINER (gridframe), game_area);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]