summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Thompson <dthompson2@worcester.edu>2023-05-02 07:30:20 -0400
committerDavid Thompson <dthompson2@worcester.edu>2023-05-02 07:30:20 -0400
commitfdd4064db9a5632cb112622d84c0a143beed5fe8 (patch)
treec65cc0206e47c3088052d9077165029b2b960116
parent298e387899206497d0c5a962aba7715cd668ea36 (diff)
graphics: engine: Remove dynamic-wind from with-graphics-state.
-rw-r--r--chickadee/graphics/engine.scm12
1 files changed, 5 insertions, 7 deletions
diff --git a/chickadee/graphics/engine.scm b/chickadee/graphics/engine.scm
index 804e705..e5b2d4d 100644
--- a/chickadee/graphics/engine.scm
+++ b/chickadee/graphics/engine.scm
@@ -310,13 +310,11 @@
(loop (guardian))))))
(define-syntax-rule (with-graphics-state ((spec value) ...) body ...)
- (dynamic-wind
- (lambda ()
- (graphics-engine-state-push! spec value) ...)
- (lambda ()
- body ...)
- (lambda ()
- (graphics-engine-state-pop! spec) ...)))
+ (begin
+ (graphics-engine-state-push! spec value) ...
+ (let ((result (begin body ...)))
+ (graphics-engine-state-pop! spec) ...
+ result) ))
(define-syntax-rule (with-graphics-state! ((spec value) ...) body ...)
(with-graphics-state ((spec value) ...)