Thanks Chongkai - i&#39;ll look into the approach below more.<br><br><div class="gmail_quote">On Tue, Mar 24, 2009 at 12:24 AM, Chongkai Zhu <span dir="ltr">&lt;<a href="mailto:czhu@cs.utah.edu">czhu@cs.utah.edu</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">#lang scheme<br>
(require scheme/foreign)<br>
<br>
(define your-object &#39;x)<br>
(define release display)<br>
<br>
(define custodian (make-custodian))<br>
<br>
(unsafe!)<br>
((get-ffi-obj &quot;scheme_add_managed&quot; #f<br>
             (_fun _scheme _scheme (_fun _scheme _pointer -&gt; _void) _pointer _int<br>
                   -&gt; _pointer))<br>
custodian<br>
your-object<br>
(lambda (your-object _) (release your-object))<br>
#f<br>
1)<br>
<br>
(custodian-shutdown-all custodian)<br>
<br>
</blockquote></div><br>