IconLoader requires restart IDE if uninstall or update plugin?

Answered

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...

5 comments
Comment actions Permalink

What is your IDE build you're testing against? Possibly related https://youtrack.jetbrains.com/issue/IDEA-262343

 

0
Comment actions Permalink

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.DynamicPluginListener will help resolve this?

0
Comment actions Permalink

Thanks, it looks it's known problem with icon/structure view mentioned here https://youtrack.jetbrains.com/issue/IDEA-259005

 

0
Comment actions Permalink

I tried to unregistry my PsiStructureViewFactory, and it did work. But according to IDEA-259005 , is there any way to resolve this temporarily?

0
Comment actions Permalink

Unfortunately this will require platform changes.

0

Please sign in to leave a comment.