diff --git a/collects/ffi/unsafe/alloc.rkt b/collects/ffi/unsafe/alloc.rkt index 634667daed..5b03678069 100644 --- a/collects/ffi/unsafe/alloc.rkt +++ b/collects/ffi/unsafe/alloc.rkt @@ -51,10 +51,11 @@ (dynamic-wind start-atomic (lambda () - (apply proc args) - (let ([v (get-arg args)]) - (let ([ds (hash-ref allocated v null)]) - (hash-set! allocated v (cons d ds))))) + (begin0 + (apply proc args) + (let ([v (get-arg args)]) + (let ([ds (hash-ref allocated v null)]) + (hash-set! allocated v (cons d ds)))))) end-atomic)) proc))