Fixing bug in exception-protect.

This commit is contained in:
Alex Shinn 2014-03-21 14:26:45 +09:00
parent 9f518e56c4
commit 45f7d85360

View file

@ -997,12 +997,12 @@
;; Similar to unwind-protect, but allows escape via continuations
;; assuming they'll return, whereas exceptions are assumed to not return.
(define (with-exception-protect thunk final)
(let ((finalized? #f)
(run-finalize
(lambda ()
(cond ((not finalized?)
(set! finalized? #t)
(final))))))
(let* ((finalized? #f)
(run-finalize
(lambda ()
(cond ((not finalized?)
(set! finalized? #t)
(final))))))
(with-exception-handler
(lambda (exn)
(run-finalize)