[gnome-robots] Fix critical on game shutdown



commit 6149e11402d8c20e8aef3e2802f5918025b154db
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 9b5e567..39c8a62 100644
--- a/src/gnome-robots.c
+++ b/src/gnome-robots.c
@@ -348,6 +348,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]