Skip to content

Commit 7f4aa1f

Browse files
authored
Unregister package before installing instead of unloading (#2437)
Closes #2349
1 parent 4e3b7c3 commit 7f4aa1f

2 files changed

Lines changed: 6 additions & 1 deletion

File tree

NEWS.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
# devtools (development version)
22

3+
* `install(reload = TRUE)` now calls `pkgload::unregister()` instead
4+
of `pkload::unload()` (#2349). This allows the package to keep
5+
functioning if it is still in use in the R session (e.g. through
6+
event handlers).
7+
38
* `test()` no longer calls `load_all()` twice. `test_active_file()`
49
now calls `load_all()` via testthat.
510

R/install.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ install <-
9696
was_attached <- is_attached(pkg)
9797

9898
if (reload && was_loaded) {
99-
pkgload::unload(pkg$package)
99+
pkgload::unregister(pkg$package)
100100
}
101101

102102
pkgbuild::with_build_tools(required = FALSE,

0 commit comments

Comments
 (0)