From f1ab0b895e2cd6071028c91aff0157bad7c362cc Mon Sep 17 00:00:00 2001 From: Aleksey Pivovarov Date: Thu, 26 Oct 2017 13:54:19 +0300 Subject: [PATCH] diff: do not register annotations on disposed Editor This is a possible fix for "Memory leak detected: com.intellij.openapi.vcs.actions.AnnotateToggleAction$1" --- .../com/intellij/openapi/vcs/actions/AnnotateToggleAction.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/platform/vcs-impl/src/com/intellij/openapi/vcs/actions/AnnotateToggleAction.java b/platform/vcs-impl/src/com/intellij/openapi/vcs/actions/AnnotateToggleAction.java index eba0f9d17903..fbb200453c13 100644 --- a/platform/vcs-impl/src/com/intellij/openapi/vcs/actions/AnnotateToggleAction.java +++ b/platform/vcs-impl/src/com/intellij/openapi/vcs/actions/AnnotateToggleAction.java @@ -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);