mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
[vcs-log] dispose VcsLogProgress with project
This commit is contained in:
@@ -93,8 +93,7 @@ public class VcsLogData implements Disposable, VcsLogDataProvider {
|
||||
myUserRegistry = (VcsUserRegistryImpl)ServiceManager.getService(project, VcsUserRegistry.class);
|
||||
myFatalErrorsConsumer = fatalErrorsConsumer;
|
||||
|
||||
VcsLogProgress progress = new VcsLogProgress();
|
||||
Disposer.register(this, progress);
|
||||
VcsLogProgress progress = new VcsLogProgress(project, this);
|
||||
|
||||
VcsLogCachesInvalidator invalidator = CachesInvalidator.EP_NAME.findExtension(VcsLogCachesInvalidator.class);
|
||||
if (invalidator.isValid()) {
|
||||
|
||||
@@ -20,6 +20,7 @@ import com.intellij.openapi.application.ApplicationManager;
|
||||
import com.intellij.openapi.progress.EmptyProgressIndicator;
|
||||
import com.intellij.openapi.progress.ProgressIndicator;
|
||||
import com.intellij.openapi.progress.util.AbstractProgressIndicatorBase;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.util.Disposer;
|
||||
import com.intellij.util.containers.ContainerUtil;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
@@ -35,6 +36,11 @@ public class VcsLogProgress implements Disposable {
|
||||
@NotNull private final Set<ProgressIndicator> myTasksWithVisibleProgress = ContainerUtil.newHashSet();
|
||||
@NotNull private final Set<ProgressIndicator> myTasksWithSilentProgress = ContainerUtil.newHashSet();
|
||||
|
||||
public VcsLogProgress(@NotNull Project project, @NotNull Disposable parent) {
|
||||
Disposer.register(parent, () -> Disposer.dispose(this));
|
||||
Disposer.register(project, this);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public ProgressIndicator createProgressIndicator() {
|
||||
return createProgressIndicator(true);
|
||||
|
||||
@@ -210,7 +210,7 @@ public class VcsLogRefresherTest extends VcsPlatformTest {
|
||||
}
|
||||
}, myProject);
|
||||
return new VcsLogRefresherImpl(myProject, myLogData.getStorage(), myLogProviders, myLogData.getUserRegistry(), myLogData.getIndex(),
|
||||
new VcsLogProgress(),
|
||||
new VcsLogProgress(myProject, myLogData),
|
||||
myLogData.getTopCommitsCache(), dataPackConsumer, FAILING_EXCEPTION_HANDLER, RECENT_COMMITS_COUNT
|
||||
) {
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user