unwrap thread's WrappedProgressIndicator when inner indicator is cancelled, same way as we do during registerIndicatorAndRun (IDEA-132931)

This commit is contained in:
Maxim.Mossienko
2014-11-14 19:46:10 +01:00
parent ecea2a02e6
commit 54d28fa7c9
@@ -323,7 +323,19 @@ public class ProgressManagerImpl extends ProgressManager implements Disposable {
if (threads != null) {
for (Thread thread : threads) {
ProgressIndicator currentIndicator = getCurrentIndicator(thread);
if (currentIndicator == indicator) {
boolean underCancelledIndicator = currentIndicator == indicator;
if (!underCancelledIndicator && currentIndicator instanceof WrappedProgressIndicator) {
while(currentIndicator instanceof WrappedProgressIndicator) {
ProgressIndicator originalProgressIndicator = ((WrappedProgressIndicator)currentIndicator).getOriginalProgressIndicator();
if (originalProgressIndicator == indicator) {
underCancelledIndicator = true;
break;
}
currentIndicator = originalProgressIndicator;
}
}
if (underCancelledIndicator) {
threadsUnderCanceledIndicator.add(thread);
}
}