Skip to content

Commit 472cc3f

Browse files
BUG FIX: The built-in checks for added, removed, or modified graphical devices, could produce false positives [#788]
1 parent b55bb94 commit 472cc3f

File tree

3 files changed

+15
-2
lines changed

3 files changed

+15
-2
lines changed

DESCRIPTION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
Package: future
2-
Version: 1.49.0-9013
2+
Version: 1.49.0-9014
33
Title: Unified Parallel and Distributed Processing in R for Everyone
44
Depends:
55
R (>= 3.2.0)

NEWS.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,13 @@
1111
fails to communicate with one or more of the parallel workers, it
1212
will now close any socket connections that remain open towards such
1313
cluster nodes.
14+
15+
* The built-in checks for added, removed, or modified graphical
16+
devices, could produce false positives, complaining about "A future
17+
expression must close any opened devices and must not close devices
18+
it did not open. Details: 1 devices differ: index=2, before='NA',
19+
after=''". The problem was that it did not prune the empty 'after'
20+
before the check.
1421

1522

1623
# Version 1.49.0 [2025-05-08]

R/backend_api-evalFuture.R

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -343,6 +343,12 @@ diff_globalenv <- function(before, after = names(.GlobalEnv)) {
343343

344344

345345
diff_devices <- function(before, after = base::.Devices) {
346+
## Prune
347+
before <- unlist(before)
348+
before <- before[before != ""]
349+
after <- unlist(after)
350+
after <- after[after != ""]
351+
## Compare
346352
n_before <- length(before)
347353
n_after <- length(after)
348354
n <- max(n_before, n_after)
@@ -353,7 +359,7 @@ diff_devices <- function(before, after = base::.Devices) {
353359
data[[kk]] <- data.frame(index = kk, before = before_kk, after = after_kk, identical = identical(after_kk, before_kk))
354360
}
355361
data <- do.call(rbind, data)
356-
data <- data[!data[["identical"]], ]
362+
data <- data[!data[["identical"]], ]
357363
if (nrow(data) == 0L) NULL else data
358364
}
359365

0 commit comments

Comments
 (0)