fix custodian problem with register-finalizer

svn: r14988
This commit is contained in:
Matthew Flatt 2009-05-26 20:01:54 +00:00
parent e1374bcbd9
commit 070ed03d90

View File

@ -1618,9 +1618,11 @@
(define* (register-finalizer obj finalizer)
(unless killer-thread
(set! killer-thread
(thread (lambda ()
(let loop () (will-execute killer-executor) (loop))))))
(let ([priviledged-custodian ((get-ffi-obj 'scheme_make_custodian #f (_fun _pointer -> _scheme)) #f)])
(set! killer-thread
(parameterize ([current-custodian priviledged-custodian])
(thread (lambda ()
(let loop () (will-execute killer-executor) (loop))))))))
(will-register killer-executor obj finalizer))
(define-unsafer unsafe!)