diff: do not register annotations on disposed Editor

This is a possible fix for "Memory leak detected: com.intellij.openapi.vcs.actions.AnnotateToggleAction$1"
This commit is contained in:
Aleksey Pivovarov
2017-10-26 14:23:29 +03:00
parent 896b6d7b2a
commit f1ab0b895e
@@ -120,6 +120,8 @@ public class AnnotateToggleAction extends ToggleAction implements DumbAware {
@NotNull final AbstractVcs vcs,
@NotNull final UpToDateLineNumberProvider upToDateLineNumbers,
final boolean warnAboutSuspiciousAnnotations) {
if (project.isDisposed() || editor.isDisposed()) return;
if (warnAboutSuspiciousAnnotations) {
int expectedLines = Math.max(upToDateLineNumbers.getLineCount(), 1);
int actualLines = Math.max(fileAnnotation.getLineCount(), 1);