From: Guillermo J. Rozas <edu/mit/csail/zurich/gjr>
Date: Tue, 7 Sep 1993 19:08:01 +0000 (+0000)
Subject: Attempt to preclude multiple catatonia windows for showing up.
X-Git-Tag: 20090517-FFI~7893
X-Git-Url: https://birchwood-abbey.net/git?a=commitdiff_plain;h=370846ee7d96a24833e080ec3a9cc7de36d7f6a6;p=mit-scheme.git

Attempt to preclude multiple catatonia windows for showing up.
---

diff --git a/v7/src/microcode/ntgui.c b/v7/src/microcode/ntgui.c
index a9542e9a3..b0531fff2 100644
--- a/v7/src/microcode/ntgui.c
+++ b/v7/src/microcode/ntgui.c
@@ -1,6 +1,6 @@
 /* -*-C-*-
 
-$Id: ntgui.c,v 1.9 1993/09/04 07:03:43 gjr Exp $
+$Id: ntgui.c,v 1.10 1993/09/07 19:08:01 gjr Exp $
 
 Copyright (c) 1993 Massachusetts Institute of Technology
 
@@ -194,21 +194,31 @@ extern void catatonia_trigger (void);
 void
 catatonia_trigger (void)
 {
-  if ((MessageBox (master_tty_window,
-		   "Scheme appears to have become catatonic.\n"
-		   "OK to kill it?",
-		   "MIT Scheme",
-		   (MB_ICONSTOP | MB_OKCANCEL)))
-      == IDOK)
+  int mes_result;
+  static BOOL already_exitting = FALSE;
+  SCHEME_OBJECT saved = Registers[REGBLOCK_CATATONIA_LIMIT];
+
+  Registers[REGBLOCK_CATATONIA_LIMIT] = 0;
+
+  mes_result = (MessageBox (master_tty_window,
+			    "Scheme appears to have become catatonic.\n"
+			    "OK to kill it?",
+			    "MIT Scheme",
+			    (MB_ICONSTOP | MB_OKCANCEL)));
+
+  Registers[REGBLOCK_CATATONIA_COUNTER] = 0;
+  Registers[REGBLOCK_CATATONIA_LIMIT] = saved;
+
+  if (mes_result != IDOK)
+    return;
+  else if (already_exitting)
+    exit (1);
+  else
   {
     extern void termination_normal (int);
+    already_exitting = TRUE;
     termination_normal (0);
   }
-  else
-  {
-    Registers[REGBLOCK_CATATONIA_COUNTER] = 0;
-    return;
-  }
 }
 
 static void