File tree Expand file tree Collapse file tree 1 file changed +11
-3
lines changed
Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Original file line number Diff line number Diff line change 22# NOTE: we intentionally do _not_ load tbbmalloc_proxy as its intended
33# use is to replace the default allocator, something that is dangerous
44# to do by default (and especially should only be done via e.g. LD_PRELOAD)
5+ .dllInfo <- NULL
56.tbbDllInfo <- NULL
67.tbbMallocDllInfo <- NULL
78
@@ -26,15 +27,22 @@ loadTbbLibrary <- function(name) {
2627 .tbbDllInfo <<- loadTbbLibrary(" tbb" )
2728 .tbbMallocDllInfo <<- loadTbbLibrary(" tbbmalloc" )
2829
29- # load RcppParallel library
30- library.dynam(" RcppParallel" , pkgname , libname )
30+ # load RcppParallel library if available
31+ # (work around https://github.com/r-lib/devtools/issues/2343)
32+ if (! file.exists(file.path(libname , pkgname , " lib" )))
33+ return ()
34+
35+ .dllInfo <<- library.dynam(" RcppParallel" , pkgname , libname )
3136
3237}
3338
3439.onUnload <- function (libpath ) {
3540
3641 # unload the package library
37- library.dynam.unload(" RcppParallel" , libpath )
42+ if (! is.null(.dllInfo )) {
43+ library.dynam.unload(" RcppParallel" , libpath )
44+ .dllInfo <<- NULL
45+ }
3846
3947 # unload tbb_malloc if we loaded it
4048 if (! is.null(.tbbMallocDllInfo )) {
You can’t perform that action at this time.
0 commit comments