diff --git a/R/qsys_multicore.r b/R/qsys_multicore.r index 7a64ffd..8d3eb8d 100644 --- a/R/qsys_multicore.r +++ b/R/qsys_multicore.r @@ -47,10 +47,9 @@ MULTICORE = R6::R6Class("MULTICORE", }, children = list(), - is_cleaned_up = TRUE, #TODO: finalize = function(quiet=FALSE) { - if (!private$is_cleaned_up) { + if (length(private$children) > 0) { private$collect_children(wait=FALSE, timeout=0) running = names(private$children) if (length(running) > 0) { @@ -60,7 +59,7 @@ MULTICORE = R6::R6Class("MULTICORE", immediate.=TRUE) tools::pskill(running, tools::SIGKILL) } - private$is_cleaned_up = TRUE + private$children = list() } } )