On Tue, 11 May 2021 19:36:12 GMT, Alexey Ivanov <aiva...@openjdk.org> wrote:

>> I will create a separate bug to track this - i do not know if library 
>> loading gets cached on some level and what impact on performance will we 
>> have if we release it every call. But i will check it out separately.
>
> Sure! I just wanted to bring it up. I could've submitted the bug myself… yet 
> I decided to ask at first.
> As far as I can see `JDK_LoadSystemLibrary` has no caching, it just loads the 
> library. If any icons are accessed `shell32.dll` will already be loaded. 
> Probably, we never fully release it from COM. So in this case, loading and 
> freeing will just increase and decrease the counters. Even if it's never 
> really unloaded, we should release the resources that's not needed any more.

For documentation purposes, 
[JDK-8266948](https://bugs.openjdk.java.net/browse/JDK-8266948): 
ShellFolder2::getIconResource does not release the library loaded.

-------------

PR: https://git.openjdk.java.net/jdk/pull/2875

Reply via email to