How to unload a dll which gets loaded by System.load(path to dll)

眉间皱痕 提交于 2020-01-14 14:18:09

问题


Is there any way to unload a DLL which gets loaded in the application using System.load() API call.


回答1:


You have to use a separate ClassLoader to load the dll. The dll is only bound to the ClassLoader it was loaded with. When the ClassLoader isn't used anymore (means no references to the ClassLoader exist), the garbage collector will free your ClassLoader and unload your dll.



来源:https://stackoverflow.com/questions/1491043/how-to-unload-a-dll-which-gets-loaded-by-system-loadpath-to-dll

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!