more robust shutdown while Isabelle_Process is starting up, e.g. quit after dialog Isabelle version for testing";
authorwenzelm
Tue, 25 Feb 2020 17:37:22 +0100
changeset 71471 c06604896c3d
parent 71470 b94053ca8d77
child 71472 c213d067e60f
child 71473 be84312a2d53
more robust shutdown while Isabelle_Process is starting up, e.g. quit after dialog Isabelle version for testing";
src/Tools/jEdit/src/plugin.scala
--- a/src/Tools/jEdit/src/plugin.scala	Mon Feb 24 23:17:41 2020 +0100
+++ b/src/Tools/jEdit/src/plugin.scala	Tue Feb 25 17:37:22 2020 +0100
@@ -197,7 +197,7 @@
           "Isabelle Syslog", GUI.scrollable_text(session.syslog_content()))
       }
 
-    case Session.Ready =>
+    case Session.Ready if !shutting_down.value =>
       init_models()
 
       if (!Isabelle.continuous_checking) {
@@ -442,6 +442,8 @@
 
   /* start and stop */
 
+  private val shutting_down = Synchronized(false)
+
   override def start()
   {
     /* strict initialization */
@@ -475,6 +477,8 @@
         Log.log(Log.ERROR, this, exn)
     }
 
+    shutting_down.change(_ => false)
+
     val view = jEdit.getActiveView()
     if (view != null) init_view(view)
   }
@@ -493,6 +497,8 @@
     }
 
     exit_models(JEdit_Lib.jedit_buffers().toList)
+
+    shutting_down.change(_ => true)
     session.stop()
     file_watcher.shutdown()
     PIDE.editor.shutdown()