handle project closing during commitAndRunReadAction
authorpeter <peter@jetbrains.com>
Mon, 7 Nov 2016 07:16:11 +0000 (08:16 +0100)
committerpeter <peter@jetbrains.com>
Mon, 7 Nov 2016 07:16:11 +0000 (08:16 +0100)
platform/core-impl/src/com/intellij/psi/impl/PsiDocumentManagerBase.java

index 2ac0a6c9194c267e12f3100d9b7c2c476efe1a1f..a16eb4c8bd1e9af2e85022f2997a50b99ec5ceff 100644 (file)
@@ -516,6 +516,12 @@ public abstract class PsiDocumentManagerBase extends PsiDocumentManager implemen
       application.invokeLater(new Runnable() {
         @Override
         public void run() {
       application.invokeLater(new Runnable() {
         @Override
         public void run() {
+          if (myProject.isDisposed()) {
+            // committedness doesn't matter anymore; give clients a chance to do checkCanceled
+            semaphore.up();
+            return;
+          }
+
           performWhenAllCommitted(new Runnable() {
             @Override
             public void run() {
           performWhenAllCommitted(new Runnable() {
             @Override
             public void run() {