diff options
-rw-r--r-- | chickadee/graphics/engine.scm | 14 |
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 ...) |