[aisleriot] sol: Fix crash in debug UI



commit f12fdcc4ece12428f5415de2047ef52c25a550f1
Author: Christian Persch <chpe gnome org>
Date:   Sat Dec 3 21:12:27 2011 +0100

    sol: Fix crash in debug UI

 src/window.c |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)
---
diff --git a/src/window.c b/src/window.c
index c9bec1e..0196370 100644
--- a/src/window.c
+++ b/src/window.c
@@ -610,6 +610,7 @@ debug_ensure_game_list (AisleriotWindow *window)
     return NULL;
   }
 
+  data = g_slice_new (DebugWindowData);
   data->window = window;
   data->games = games;
   data->n_games = n_games;
@@ -636,8 +637,10 @@ debug_cycle_timeout_cb (DebugWindowData *data)
     data->current++;
 
   /* We're done */
-  if (data->current >= data->n_games)
-    return FALSE;
+  if (data->current >= data->n_games) {
+    data->current = data->n_games - 1;
+    return FALSE; /* don't run again */
+  }
 
   aisleriot_window_set_game_module (data->window, data->games[data->current], NULL);
 



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