From a8b41e3969bf18ebd75ff2f3b645fc0225bc2885 Mon Sep 17 00:00:00 2001 From: Rustam Vishnyakov Date: Mon, 25 Nov 2019 12:12:07 +0300 Subject: [PATCH] Expire computation when a project is disposed (IDEA-227185 AssertionError: Already disposed) GitOrigin-RevId: 89b033ae5eb5b0f098b2d729cda0d946bcba4d82 --- .../options/CodeStyleCachedValueProvider.java | 28 ++++++++++--------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/platform/lang-api/src/com/intellij/application/options/CodeStyleCachedValueProvider.java b/platform/lang-api/src/com/intellij/application/options/CodeStyleCachedValueProvider.java index b3038dd1f758..a489d5482541 100644 --- a/platform/lang-api/src/com/intellij/application/options/CodeStyleCachedValueProvider.java +++ b/platform/lang-api/src/com/intellij/application/options/CodeStyleCachedValueProvider.java @@ -90,15 +90,6 @@ class CodeStyleCachedValueProvider implements CachedValueProvider computeSettings()) - .finishOnUiThread(ModalityState.NON_MODAL, val -> notifyCachedValueComputed(myFile)) + .expireWith(myProject) + .finishOnUiThread(ModalityState.NON_MODAL, val -> notifyCachedValueComputed()) .submit(ourExecutorService); } else { @@ -141,10 +135,10 @@ class CodeStyleCachedValueProvider implements CachedValueProvider notifyCachedValueComputed(myFile), ModalityState.any()); + application.invokeLater(() -> notifyCachedValueComputed(), ModalityState.any()); } } @@ -194,5 +188,13 @@ class CodeStyleCachedValueProvider implements CachedValueProvider