IconLoader requires restart IDE if uninstall or update plugin?
I'm now working on dynamic plugins following this guide: https://plugins.jetbrains.com/docs/intellij/dynamic-plugins.html
But I was in trouble after met all restrictions, my IDE still ask for restart when I uninstall my plugin. So I followed the troubleshooting and I'm confused about:
7. Every one of them is a memory leak (or part of a memory leak) that needs to be resolved.
Is that means the incoming references?
If so, I found out that there is a reference from IconLoader$ImageDataResolverImpl, is this the cause that I can't uninstall plugin without restart IDE? And how could I resolve this? Here is my icon class:
public interface MyIcons {
Icon FILE_BLUE = IconLoader.getIcon("/icons/file_blue.svg", MyIcons.class);
Icon FILE_GREEN = IconLoader.getIcon("/icons/file_green.svg", MyIcons.class);
Icon ENUM = IconLoader.getIcon("/icons/enum.svg", MyIcons.class);
Icon CLASS = IconLoader.getIcon("/icons/class.svg", MyIcons.class);
Icon SERVICE = IconLoader.getIcon("/icons/service.svg", MyIcons.class);
Icon FIELD = PlatformIcons.FIELD_ICON;
Icon ENUM_VALUE = PlatformIcons.FIELD_ICON;
Icon METHOD = PlatformIcons.METHOD_ICON;
}
By the way, I tried to replace IconLoader.getIconwith PlatformIcons to check if this is the problem, and eventually I can uninstall with out restart...
And here is my incoming references and path to GC Roots:


I really have no idea how to resolve this, please help...
Please sign in to leave a comment.
What is your IDE build you're testing against? Possibly related https://youtrack.jetbrains.com/issue/IDEA-262343
I'm testing against IDEA Community verion 2021.1 with build number IC-211.7442.40
I'm not sure if IDEA-262343 is the same question, but may be do something in
com.intellij.ide.plugins.DynamicPluginListenerwill help resolve this?Thanks, it looks it's known problem with icon/structure view mentioned here https://youtrack.jetbrains.com/issue/IDEA-259005
I tried to unregistry my PsiStructureViewFactory, and it did work. But according to IDEA-259005 , is there any way to resolve this temporarily?
Unfortunately this will require platform changes.
I know this is quite old, but if someone is facing this issue, I solved it as follows: