IJPL-928 Mark EditorImpl.RepaintCursorCommand as context-aware

Scheduling a runnable using scheduleWithFixedDelay wraps
it into a ContextRunnable under the hood, which captures the context,
which sometimes contains a reference to the project, creating a leak,
because it's a global app-wide thing.

Since this thing is pure UI code and doesn't require any context,
we mark it as context-aware to avoid capturing the context.

GitOrigin-RevId: 23240d901b6bae541b103563399a8030d5e4f1d6
This commit is contained in:
Sergei Tachenov
2024-03-27 18:01:00 +00:00
committed by intellij-monorepo-bot
parent 362a8689ab
commit d18ca94412
@@ -3,6 +3,7 @@ package com.intellij.openapi.editor.impl;
import com.intellij.application.options.EditorFontsConstants;
import com.intellij.codeWithMe.ClientId;
import com.intellij.concurrency.ContextAwareRunnable;
import com.intellij.diagnostic.Dumpable;
import com.intellij.ide.*;
import com.intellij.ide.dnd.DnDManager;
@@ -2955,7 +2956,7 @@ public final class EditorImpl extends UserDataHolderBase implements EditorEx, Hi
myCurrentDragIsSubstantial = true;
}
private static final class RepaintCursorCommand implements Runnable {
private static final class RepaintCursorCommand implements ContextAwareRunnable {
private long mySleepTime = 500;
private boolean myIsBlinkCaret = true;
private @Nullable EditorImpl myEditor;