[squeak-dev] External objects and finalization

Hans-Martin Mosner hmm at heeg.de
Sun Apr 4 11:32:17 UTC 2010


Schwab,Wilhelm K schrieb:
> Andreas,
>
> You mentioned that all handles are cleared on startup.  Is there a convenient way to tap into that for executors for external objects?
>
> Bill
>
>   
This mechanism is there to break pointers from in-image objects to
non-existant external objects, so hooking executors for external objects
here would let the image die a horrible death.

What you probably need is a WeakRegistry holding finalizers for your
ExternalStructure subclass. But beware that for any external resource
which should be freed, there should be only one ExternalStructure
instance pointing to it, so that the structure is freed only when the
image has no pointers to it anymore.

Cheers,
Hans-Martin



More information about the Squeak-dev mailing list