chiark / gitweb /
Fix a couple of robustness issues.
authorSimon Tatham <anakin@pobox.com>
Tue, 31 May 2005 08:56:33 +0000 (08:56 +0000)
committerSimon Tatham <anakin@pobox.com>
Tue, 31 May 2005 08:56:33 +0000 (08:56 +0000)
[originally from svn r5873]

gtk.c
mines.c

diff --git a/gtk.c b/gtk.c
index 81aeda1df8936b4a214bf6ed06d34a91a269f917..742c18c2e9741ab9e750127a0c821b207d9035f3 100644 (file)
--- a/gtk.c
+++ b/gtk.c
@@ -1011,7 +1011,11 @@ static frontend *new_window(char *game_id, char **error)
 
     fe = snew(frontend);
 
+    fe->timer_active = FALSE;
+    fe->timer_id = -1;
+
     fe->me = midend_new(fe, &thegame);
+
     if (game_id) {
         *error = midend_game_id(fe->me, game_id);
         if (*error) {
@@ -1200,8 +1204,6 @@ static frontend *new_window(char *game_id, char **error)
     fe->fonts = NULL;
     fe->nfonts = fe->fontsize = 0;
 
-    fe->timer_active = FALSE;
-
     fe->paste_data = NULL;
     fe->paste_data_len = 0;
 
diff --git a/mines.c b/mines.c
index e0add2ac6a4fd323a0b8c29039f151f6b65ccb77..62af8cb001b4a19f306121f32ec5aa1c59f067ab 100644 (file)
--- a/mines.c
+++ b/mines.c
@@ -2089,6 +2089,8 @@ static game_state *new_game(midend_data *me, game_params *params, char *desc)
        state->layout->me = me;
 
     } else {
+       state->layout->rs = NULL;
+       state->layout->me = NULL;
 
        state->layout->mines = snewn(wh, char);
        x = atoi(desc);