more robust, e.g. for "isabelle dump";
--- a/src/Pure/PIDE/headless.scala Mon Oct 17 22:32:19 2022 +0200
+++ b/src/Pure/PIDE/headless.scala Mon Oct 17 22:39:44 2022 +0200
@@ -357,7 +357,7 @@
val delay_commit_clean =
Delay.first(commit_cleanup_delay max Time.zero) {
val clean_theories = use_theories_state.change_result(_.clean_theories)
- if (clean_theories.nonEmpty) {
+ if (clean_theories.nonEmpty && session.is_ready) {
progress.echo("Removing " + clean_theories.length + " theories ...")
resources.clean_theories(session, id, clean_theories)
}