Skip to content

Commit

Permalink
Unregister package before installing instead of unloading
Browse files Browse the repository at this point in the history
Closes r-lib#2349
  • Loading branch information
lionel- committed Jun 8, 2022
1 parent dd960cc commit e56259b
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
4 changes: 3 additions & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ Imports:
miniUI (>= 0.1.1.1),
pkgbuild (>= 1.3.1),
pkgdown (>= 2.0.2),
pkgload (>= 1.2.4),
pkgload (>= 1.2.4.9001),
profvis (>= 0.3.7),
rcmdcheck (>= 1.4.0),
remotes (>= 2.4.2),
Expand Down Expand Up @@ -62,6 +62,8 @@ Suggests:
spelling (>= 2.2)
VignetteBuilder:
knitr
Remotes:
r-lib/pkgload
Config/Needs/website: tidyverse/tidytemplate
Encoding: UTF-8
Language: en-US
Expand Down
5 changes: 5 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# devtools (development version)

* `install(reload = TRUE)` now calls `pkgload::unregister()` instead
of `pkload::unload()` (#2349). This allows the package to keep
functioning if it is still in use in the R session (e.g. through
event handlers).

* `aspell_env_var()` does a better job of matching R CMD check behaviour,
which is only to use `aspell`, not `hunspell` or `ispell` (#2376).

Expand Down
2 changes: 1 addition & 1 deletion R/install.R
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ install <-
was_attached <- is_attached(pkg)

if (reload && was_loaded) {
pkgload::unload(pkg$package)
pkgload::unregister(pkg$package)
}

pkgbuild::with_build_tools(required = FALSE,
Expand Down

0 comments on commit e56259b

Please sign in to comment.