case: Add support for debugging case reference count leaks.
[pspp-builds.git] / src / ui / terminal / main.c
index 1be99732d7df6d002c6cbc8cfa705600729f7dc7..64a7d2ec013e97a732b782570c25869b85fa669b 100644 (file)
@@ -72,7 +72,6 @@ static void add_syntax_file (struct source_stream *, enum syntax_mode,
                              const char *file_name);
 static void bug_handler(int sig);
 static void fpu_init (void);
-static void clean_up (void);
 
 /* Program entry point. */
 int
@@ -88,7 +87,6 @@ main (int argc, char **argv)
   signal (SIGABRT, bug_handler);
   signal (SIGSEGV, bug_handler);
   signal (SIGFPE, bug_handler);
-  at_fatal_signal (clean_up);
 
   i18n_init ();
   fpu_init ();
@@ -154,7 +152,19 @@ main (int argc, char **argv)
     }
 
 
-  clean_up ();
+  destroy_dataset (the_dataset);
+
+  random_done ();
+  settings_done ();
+  fh_done ();
+  lex_destroy (the_lexer);
+  destroy_source_stream (the_source_stream);
+  prompt_done ();
+  readln_uninitialize ();
+  output_close ();
+  msg_ui_done ();
+  i18n_done ();
+
   return msg_ui_any_errors ();
 }
 
@@ -202,30 +212,6 @@ bug_handler(int sig)
   raise (sig);
 }
 
-/* Clean up PSPP in preparation for termination.  */
-static void
-clean_up (void)
-{
-  static bool terminating = false;
-  if (!terminating)
-    {
-      terminating = true;
-
-      destroy_dataset (the_dataset);
-
-      random_done ();
-      settings_done ();
-      fh_done ();
-      lex_destroy (the_lexer);
-      destroy_source_stream (the_source_stream);
-      prompt_done ();
-      readln_uninitialize ();
-      output_close ();
-      msg_ui_done ();
-      i18n_done ();
-    }
-}
-
 static void
 add_syntax_file (struct source_stream *ss, enum syntax_mode syntax_mode,
                  const char *file_name)