Skip to content
Prev 31477 / 63424 Next

How to unload a dll loaded via library.dynam()?

[Moved to R-devel as suggested.]

library.dynam.unload() does work if the OS is cooperative.  And if you 
have your package set up correctly and unload the namespace (and not 
just detach the package if there is a namespace) then the shared 
object/DLL will be unloaded. There are examples in several base R 
packages (grDevices, grid, methods, splines, stats, tools).

However, there are several instances on Windows (tcltk is one) where 
reloading the package DLL does not work, and this seems to be because 
dependent DLLs are already loaded and do not run their initializations 
correctly.  I've not seen problems on Linux.  On Solaris reloading a 
different shared object of the same name into a process used not to 
work (you got the first version under that name): I've not checked 
recently.
On Fri, 20 Feb 2009, G?bor Cs?rdi wrote:

            
Why not use the one already provided?