[plt-scheme] register-finalizer wills only executed first time program is Run in DrScheme session

From: Neil Van Dyke (neil at neilvandyke.org)
Date: Tue May 26 05:12:06 EDT 2009

This is with 4.1.5 on Linux.

Neil Van Dyke wrote at 05/26/2009 05:09 AM:
> I have implemented some code using "scheme/foreign" that uses 
> "register-finalizer" to clean up some resources.
>
> When I run the test suite in a new DrScheme and then do 
> "(collect-garbage)", the finalizers execute.
>
> This is the problem: When I hit Run a second time, the test suite runs 
> again correctly, but even hundreds of calls to "collect-garbage" do 
> not cause the finalizers to execute.
>
> When I do this in a REPL from the "mzscheme" command-line program, the 
> finalizers always execute after each run of the test suite followed by 
> a call to "collect-garbage".
>
> Any ideas appreciated.
>



Posted on the users mailing list.