HenrikBengtsson / illuminaio

🔬 R package: This is the Bioconductor devel version of the illuminaio package.
http://bioconductor.org/packages/devel/bioc/html/illuminaio.html
6 stars 2 forks source link

BUG: Unload package does not unload DLL #9

Closed HenrikBengtsson closed 8 years ago

HenrikBengtsson commented 8 years ago

Issue

In a fresh R session, we get:

> loadNamespace("illuminaio")
> names(getLoadedDLLs())
[1] "base"       "methods"    "utils"      "grDevices"  "graphics"
[6] "stats"      "base64"     "illuminaio"
> unloadNamespace("illuminaio")
> loadedNamespaces()
[1] "graphics"  "base64"    "utils"     "grDevices" "stats"     "datasets"
[7] "methods"   "base"
> names(getLoadedDLLs())
[1] "base"       "methods"    "utils"      "grDevices"  "graphics"
[6] "stats"      "base64"     "illuminaio"

Note how the illuminaio DLL is still there.

Solution

Add

.onUnload <- function(libpath) {
  library.dynam.unload("illuminaio", 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.