From 5e1518c2bb7079f516a22ff40decbaeca79e4524 Mon Sep 17 00:00:00 2001 From: Tony Garnock-Jones Date: Fri, 11 Jun 2021 09:57:35 +0200 Subject: [PATCH] Avoid caching turn past a user action (which causes problems if we suspend/resume across turns) --- syndicate/actor.rkt | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/syndicate/actor.rkt b/syndicate/actor.rkt index 1fd7fdf..780b520 100644 --- a/syndicate/actor.rkt +++ b/syndicate/actor.rkt @@ -484,13 +484,14 @@ (define (stop-if-inert-after action) (lambda () - (define turn (current-turn)) - (define f (turn-active-facet turn)) + (define f (turn-active-facet (current-turn))) (action) - (turn-enqueue! turn f (lambda () - (when (or (and (facet-parent f) (not (facet-live? (facet-parent f)))) - (facet-inert? f)) - (turn-stop! (current-turn))))))) + (turn-enqueue! (current-turn) + f + (lambda () + (when (or (and (facet-parent f) (not (facet-live? (facet-parent f)))) + (facet-inert? f)) + (turn-stop! (current-turn))))))) (define (deliver maybe-proc . args) (when maybe-proc