Skip to content

Commit f39879c

Browse files
BUG FIX: evalFuture() failed to restore objects in globalenv() on MS Windows
1 parent e7d0f9e commit f39879c

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
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.34.0-9118
2+
Version: 1.34.0-9119
33
Title: Unified Parallel and Distributed Processing in R for Everyone
44
Imports:
55
digest,

R/expressions.R

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -452,8 +452,8 @@ evalFuture <- function(
452452
if (length(globals) > 0) {
453453
## Preserve globals in all environments until the global environment
454454
names <- names(globals)
455-
envs <- list()
456-
oldEnvs <- list()
455+
currEnvs <- list()
456+
pastEnvs <- list()
457457
env <- globalenv()
458458
repeat {
459459
if (identical(env, emptyenv())) break
@@ -473,8 +473,8 @@ evalFuture <- function(
473473
}, error = identity)
474474
}
475475
}
476-
envs <- c(envs, env)
477-
oldEnvs <- c(oldEnvs, oldEnv)
476+
currEnvs <- c(currEnvs, env)
477+
pastEnvs <- c(pastEnvs, oldEnv)
478478
if (identical(env, globalenv())) break
479479
env <- parent.env(env)
480480
}
@@ -483,9 +483,9 @@ evalFuture <- function(
483483
## Remove globals from the global environment
484484
rm(list = names(globals), envir = genv, inherits = FALSE)
485485
## Restore objects in all modified environments
486-
for (ee in seq_along(envs)) {
487-
oldEnv <- oldEnvs[[ee]]
488-
env <- envs[[ee]]
486+
for (ee in seq_along(currEnvs)) {
487+
oldEnv <- pastEnvs[[ee]]
488+
env <- currEnvs[[ee]]
489489
for (name in names(oldEnv)) {
490490
value <- get(name, envir = oldEnv, inherits = FALSE)
491491
assign(name, value = value, envir = env, inherits = FALSE)

0 commit comments

Comments
 (0)