From e5cd1f303f664c17c2d4400e329259a9dd0488bb Mon Sep 17 00:00:00 2001 From: Jay McCarthy Date: Tue, 6 Aug 2019 16:31:48 -0400 Subject: [PATCH] Ensure that chaos is stopped on exceptions --- word.rkt | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/word.rkt b/word.rkt index d094735..8f51f32 100644 --- a/word.rkt +++ b/word.rkt @@ -84,8 +84,7 @@ (define (call-with-chaos c t) (chaos-start! c) (parameterize ([current-chaos c]) - (begin0 (t) - (chaos-stop! c)))) + (dynamic-wind void t (λ () (chaos-stop! c))))) (define (fiat-lux w) (define c (current-chaos))