From 4e8310a4f3ecd1a65b635288eb3396d311ad905e Mon Sep 17 00:00:00 2001 From: "Maxim.Mossienko" Date: Fri, 28 Apr 2017 12:42:20 +0200 Subject: [PATCH] in deactivate ask to terminate background children calculation to avoid edt blocking --- .../src/com/intellij/ide/util/treeView/AbstractTreeUi.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/platform/platform-api/src/com/intellij/ide/util/treeView/AbstractTreeUi.java b/platform/platform-api/src/com/intellij/ide/util/treeView/AbstractTreeUi.java index af488ee2128a..bd43b9a374c9 100644 --- a/platform/platform-api/src/com/intellij/ide/util/treeView/AbstractTreeUi.java +++ b/platform/platform-api/src/com/intellij/ide/util/treeView/AbstractTreeUi.java @@ -408,7 +408,8 @@ public class AbstractTreeUi { myBusyAlarm.cancelAllRequests(); if (!myWasEverShown) return; - + // ask for termination of background children calculation + if (myProgress != null && myProgress.isRunning()) myProgress.cancel(); if (!isReady()) { cancelUpdate(); myUpdateFromRootRequested = true; @@ -918,7 +919,7 @@ public class AbstractTreeUi { while(true) { try (LockToken ignored = attemptLock()) { if (ignored == null) { // async children calculation is in progress under lock - if (!myProgress.isCanceled()) myProgress.cancel(); + if (myProgress != null && myProgress.isRunning()) myProgress.cancel(); continue; } final AtomicBoolean update = new AtomicBoolean();