mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IDEA-197838 Project leak via animated icon in PluginsGroupComponentWithProgress
This commit is contained in:
@@ -464,6 +464,7 @@ public class PluginManagerConfigurableNew
|
||||
public void disposeUIResources() {
|
||||
myPluginsModel.toBackground();
|
||||
Disposer.dispose(mySearchUpdateAlarm);
|
||||
myTrendingSearchPanel.loading(false);
|
||||
|
||||
if (myShutdownCallback != null) {
|
||||
myShutdownCallback.run();
|
||||
|
||||
+15
-9
@@ -16,15 +16,7 @@ import java.awt.*;
|
||||
* @author Alexander Lobas
|
||||
*/
|
||||
public class PluginsGroupComponentWithProgress extends PluginsGroupComponent {
|
||||
private AsyncProcessIcon myIcon = new AsyncProcessIcon.Big("Loading") {
|
||||
@NotNull
|
||||
@Override
|
||||
protected Rectangle calculateBounds(@NotNull JComponent container) {
|
||||
Dimension size = container.getSize();
|
||||
Dimension iconSize = getPreferredSize();
|
||||
return new Rectangle((size.width - iconSize.width) / 2, (size.height - iconSize.height) / 2, iconSize.width, iconSize.height);
|
||||
}
|
||||
};
|
||||
private AsyncProcessIcon myIcon = new CenteredIcon();
|
||||
|
||||
public PluginsGroupComponentWithProgress(@NotNull LayoutManager layout,
|
||||
@NotNull EventHandler eventHandler,
|
||||
@@ -88,4 +80,18 @@ public class PluginsGroupComponentWithProgress extends PluginsGroupComponent {
|
||||
Disposer.dispose(myIcon);
|
||||
myIcon = null;
|
||||
}
|
||||
|
||||
private static class CenteredIcon extends AsyncProcessIcon.Big {
|
||||
public CenteredIcon() {
|
||||
super("Loading");
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
protected Rectangle calculateBounds(@NotNull JComponent container) {
|
||||
Dimension size = container.getSize();
|
||||
Dimension iconSize = getPreferredSize();
|
||||
return new Rectangle((size.width - iconSize.width) / 2, (size.height - iconSize.height) / 2, iconSize.width, iconSize.height);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -116,7 +116,7 @@ public abstract class SearchResultPanel {
|
||||
|
||||
protected abstract void handleQuery(@NotNull String query, @NotNull PluginsGroup result);
|
||||
|
||||
private void loading(boolean start) {
|
||||
public void loading(boolean start) {
|
||||
PluginsGroupComponentWithProgress panel = (PluginsGroupComponentWithProgress)myPanel;
|
||||
if (start) {
|
||||
panel.startLoading();
|
||||
|
||||
Reference in New Issue
Block a user