summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Thompson <dthompson2@worcester.edu>2021-01-26 18:21:21 -0500
committerDavid Thompson <dthompson2@worcester.edu>2021-01-26 18:21:21 -0500
commit357f864e7be790b775a1bd2a5a503af696fe707c (patch)
tree02364039233bf1e7fa9d85db1158aec21c73e14c
parentc356e8f4e82e89508867c90add122cf015166301 (diff)
graphics: engine: Attempt to fix finalizers again.
-rw-r--r--chickadee/graphics/engine.scm14
1 files changed, 7 insertions, 7 deletions
diff --git a/chickadee/graphics/engine.scm b/chickadee/graphics/engine.scm
index bbb1667..eda1547 100644
--- a/chickadee/graphics/engine.scm
+++ b/chickadee/graphics/engine.scm
@@ -261,13 +261,13 @@
(let ((guardian (graphics-engine-guardian engine)))
(let loop ((obj (guardian)))
(when obj
- (let ((finalizer (find (match-lambda
- ((name . f)
- ((graphics-finalizer-predicate f) obj)))
- (atomic-box-ref *graphics-finalizers*))))
- (if finalizer
- ((graphics-finalizer-free finalizer) obj)
- (error "no finalizer for graphics engine object" obj)))
+ (unless (find (match-lambda
+ ((name . f)
+ (and ((graphics-finalizer-predicate f) obj)
+ ((graphics-finalizer-free finalizer) obj)
+ #t)))
+ (atomic-box-ref *graphics-finalizers*))
+ (error "no finalizer for graphics engine object" obj))
(loop (guardian))))))
(define-syntax-rule (with-graphics-state ((name value) ...) body ...)