From b93eaa19f4e6d9ade3f07167daef701d6d5dc847 Mon Sep 17 00:00:00 2001 From: Matthew Flatt Date: Thu, 16 Feb 2012 20:36:40 -0700 Subject: [PATCH] ffi/unsafe/alloc: releaser should be able to return a value --- collects/ffi/unsafe/alloc.rkt | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) 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))