stop protocol handlers as well;
authorwenzelm
Wed, 22 May 2013 16:13:52 +0200
changeset 52113 2d2b049429f3
parent 52112 3610ae73cfdb
child 52114 fa497b99dccf
stop protocol handlers as well;
src/Pure/System/session.scala
--- a/src/Pure/System/session.scala	Wed May 22 16:01:08 2013 +0200
+++ b/src/Pure/System/session.scala	Wed May 22 16:13:52 2013 +0200
@@ -98,6 +98,12 @@
           }
         case _ => false
       }
+
+    def stop(prover: Prover): Protocol_Handlers =
+    {
+      for ((_, handler) <- handlers) handler.stop(prover)
+      new Protocol_Handlers()
+    }
   }
 }
 
@@ -462,6 +468,7 @@
 
         case Stop =>
           if (phase == Session.Ready) {
+            protocol_handlers = protocol_handlers.stop(prover.get)
             global_state >> (_ => Document.State.init)  // FIXME event bus!?
             phase = Session.Shutdown
             prover.get.terminate