From d4a03a3f7cf41270a68b35558ea6c8fc9300bd45 Mon Sep 17 00:00:00 2001 From: Tony Garnock-Jones Date: Thu, 24 Nov 2022 14:29:51 +0100 Subject: [PATCH] Commit to having onStop shutdownActions run in parent facet context --- syndicate/actor.rkt | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/syndicate/actor.rkt b/syndicate/actor.rkt index 023d4ae..fbfe694 100644 --- a/syndicate/actor.rkt +++ b/syndicate/actor.rkt @@ -257,7 +257,12 @@ (with-active-facet f (lambda () (for [(c (in-hash-keys (facet-children f)))] (facet-terminate! c orderly?)) - (when orderly? (for [(h (in-list (reverse (facet-shutdown-actions f))))] (h))) + (when orderly? + (let ((actions (reverse (facet-shutdown-actions f)))) + (unless (null? actions) + (with-active-facet (or parent f) + (lambda () + (for [(h (in-list actions))] (h))))))) (let ((turn (current-turn))) (for [(a (in-hash-values (facet-outbound f)))] (turn-retract!* turn a))) (when orderly?