From f5e5faf62d7244762da29edb558c2c213015a376 Mon Sep 17 00:00:00 2001 From: Michael Schubert Date: Mon, 9 Oct 2023 21:03:34 +0200 Subject: [PATCH] simplify cleanup state --- R/qsys_multicore.r | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) 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() } } )