Fix a couple of robustness issues.
authorsimon <simon@cda61777-01e9-0310-a592-d414129be87e>
Tue, 31 May 2005 08:56:33 +0000 (08:56 +0000)
committersimon <simon@cda61777-01e9-0310-a592-d414129be87e>
Tue, 31 May 2005 08:56:33 +0000 (08:56 +0000)
git-svn-id: svn://svn.tartarus.org/sgt/puzzles@5873 cda61777-01e9-0310-a592-d414129be87e

gtk.c
mines.c

diff --git a/gtk.c b/gtk.c
index 81aeda1..742c18c 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 e0add2a..62af8cb 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);