Skip to content

Commit

Permalink
Unregister package before installing instead of unloading (#2437)
Browse files Browse the repository at this point in the history
Closes #2349
  • Loading branch information
lionel- authored Jul 20, 2022
1 parent 4e3b7c3 commit 7f4aa1f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
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).

* `test()` no longer calls `load_all()` twice. `test_active_file()`
now calls `load_all()` via testthat.

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 7f4aa1f

Please sign in to comment.