BUG: Unload package does not unload DLL
Closed this issue · 1 comments
HenrikBengtsson commented
Issue
In a fresh R session, we get:
> loadNamespace("affxparser")
> names(getLoadedDLLs())
[1] "base" "methods" "utils" "grDevices" "graphics"
[6] "stats" "base64" "affxparser"
> unloadNamespace("affxparser")
> loadedNamespaces()
[1] "graphics" "base64" "utils" "grDevices" "stats" "datasets"
[7] "methods" "base"
> names(getLoadedDLLs())
[1] "base" "methods" "utils" "grDevices" "graphics"
[6] "stats" "base64" "affxparser"
Note how the affxparser
DLL is still there.
Solution
Add
.onUnload <- function(libpath) {
library.dynam.unload("affxparser", libpath)
}
to the package.
See also
R devel thread [Rd] Is it possible to increase MAX_NUM_DLLS in future R releases?, May 2, 2016.
HenrikBengtsson commented
Hmm... this seems to have been fixed in affxparser 1.43.1 via a Bioc SVN update by myself:
Commit id: a07eb97
ROBUSTNESS: Did not seem to be needed, but package is now a good citizen and do library.dynlib.unload() when unloaded. CLEANUP: Now using requireNamespace() instead of require().
Committed by: hb
Author Name: hb
Commit date: 2015-01-18 10:01:38 -0800
Author date: 2015-01-18 10:01:38 -0800
git-svn-id: https://hedgehog.fhcrc.org/bioconductor/trunk/madman/Rpacks/affxparser@98443 bc3139a8-67e5-0310-9ffc-ced21a209358