mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IDEA-169169 Revert "IDEA-168502 ui: fix memory leak via ActionToolbarImpl"
`transparentOnly=true` mode reuses presentations from previous runs.
This reverts commit fa9d2a79f4.
This commit is contained in:
-2
@@ -951,8 +951,6 @@ public class ActionToolbarImpl extends JPanel implements ActionToolbar, QuickAct
|
||||
myPlace, myActionManager, transparentOnly);
|
||||
|
||||
if (forced || !newVisibleActions.equals(myVisibleActions)) {
|
||||
myPresentationFactory.retainAll(newVisibleActions);
|
||||
|
||||
boolean shouldRebuildUI = newVisibleActions.isEmpty() || myVisibleActions.isEmpty();
|
||||
myVisibleActions = newVisibleActions;
|
||||
|
||||
|
||||
-11
@@ -18,11 +18,9 @@ package com.intellij.openapi.actionSystem.impl;
|
||||
import com.intellij.openapi.actionSystem.AnAction;
|
||||
import com.intellij.openapi.actionSystem.Presentation;
|
||||
import com.intellij.openapi.application.ApplicationManager;
|
||||
import com.intellij.util.containers.HashSet;
|
||||
import com.intellij.util.containers.WeakHashMap;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.Map;
|
||||
|
||||
public class PresentationFactory {
|
||||
@@ -54,13 +52,4 @@ public class PresentationFactory {
|
||||
ApplicationManager.getApplication().assertIsDispatchThread();
|
||||
myAction2Presentation.clear();
|
||||
}
|
||||
|
||||
public void retainAll(@NotNull Collection<AnAction> actions) {
|
||||
HashSet<AnAction> toRemove = new HashSet<>(myAction2Presentation.keySet());
|
||||
toRemove.removeAll(actions);
|
||||
|
||||
for (AnAction action : toRemove) {
|
||||
myAction2Presentation.remove(action);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user