[plt-scheme] Finalizer or custodian for extension's resources?

From: Matthew Flatt (mflatt at cs.utah.edu)
Date: Mon Jul 14 14:03:07 EDT 2003

At Sun, 13 Jul 2003 20:10:56 +0200, Dirk Gerrits wrote:
> I'm a bit confused on how to tackle resources that need deallocation in 
> MzScheme extensions. I have tried both scheme_register_finalizer on the 
> void* itself, and scheme_add_managed on the object containing the void* 
> but neither does exactly what I want. The former only seems to call the 
> deallocation function on garbage collection of the resource, the latter 
> only when the program ends. But the resource would have to be 

The intent of the API is that if you want finalization in both cases,
then you should register both ways (i.e., both the #1 and #2 lines in
your example).


Posted on the users mailing list.