Attempt to preclude multiple catatonia windows for showing up.
authorGuillermo J. Rozas <edu/mit/csail/zurich/gjr>
Tue, 7 Sep 1993 19:08:01 +0000 (19:08 +0000)
committerGuillermo J. Rozas <edu/mit/csail/zurich/gjr>
Tue, 7 Sep 1993 19:08:01 +0000 (19:08 +0000)
v7/src/microcode/ntgui.c

index a9542e9a3a1cda32f1b470f8c5cd463513ac8373..b0531fff29f2484cc154352a23e0ec9984abba0f 100644 (file)
@@ -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