]> matita.cs.unibo.it Git - helm.git/commitdiff
Ctr-C now cleans up (with a nice warning :-)
authorClaudio Sacerdoti Coen <claudio.sacerdoticoen@unibo.it>
Wed, 19 Jul 2006 10:04:02 +0000 (10:04 +0000)
committerClaudio Sacerdoti Coen <claudio.sacerdoticoen@unibo.it>
Wed, 19 Jul 2006 10:04:02 +0000 (10:04 +0000)
matita/matita.ml

index 1645184264b6e446f35b196da1aae353daa7b1df..a70063f5fe19508501f0609ab22d7da6927e4078 100644 (file)
@@ -252,6 +252,18 @@ let _ =
   end;
   try
     GtkThread.main ()
-  with Sys.Break -> ()
+  with Sys.Break ->
+   Sys.set_signal Sys.sigint
+    (Sys.Signal_handle
+      (fun _ ->
+        prerr_endline "Still cleaning the library: don't be impatient!"));
+   prerr_endline "Matita is cleaning up. Please wait.";
+   try
+    let baseuri =
+     GrafiteTypes.get_string_option
+      (MatitaScript.current ())#grafite_status "baseuri"
+    in
+     LibraryClean.clean_baseuris [baseuri]
+   with GrafiteTypes.Option_error _ -> ()
 
 (* vim:set foldmethod=marker: *)