Skip to content

Commit

Permalink
do not attempt to unload shared libraries in package detach
Browse files Browse the repository at this point in the history
  • Loading branch information
shikokuchuo committed Nov 11, 2024
1 parent 92afc17 commit d44736d
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: mirai
Type: Package
Title: Minimalist Async Evaluation Framework for R
Version: 1.3.0.9000
Version: 1.3.0.9001
Description: Designed for simplicity, a 'mirai' evaluates an R expression
asynchronously in a parallel process, locally or distributed over the
network, with the result automatically available upon completion. Modern
Expand Down
3 changes: 2 additions & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
# mirai 1.3.0.9000 (development)
# mirai 1.3.0.9001 (development)

#### Updates

* Cleanup of packages only detaches them from the search path and does not attempt to unload them, as it is not always safe to do so (thanks @D3SL, #166).
* `serialization()` deprecated in mirai 1.2.0 is now removed.

# mirai 1.3.0
Expand Down
2 changes: 1 addition & 1 deletion R/daemon.R
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ parse_cleanup <- function(cleanup)

perform_cleanup <- function(cleanup) {
if (cleanup[1L]) rm(list = (vars <- names(.GlobalEnv))[!vars %in% .[["vars"]]], envir = .GlobalEnv)
if (cleanup[2L]) lapply((new <- search())[!new %in% .[["se"]]], detach, unload = TRUE, character.only = TRUE)
if (cleanup[2L]) lapply((new <- search())[!new %in% .[["se"]]], detach, character.only = TRUE)
if (cleanup[3L]) options(.[["op"]])
if (cleanup[4L]) gc(verbose = FALSE)
}
Expand Down

0 comments on commit d44736d

Please sign in to comment.