Garbage collection hook ?

John M McIntosh johnmci at smalltalkconsulting.com
Fri Nov 7 22:46:10 UTC 2003


You should look at the weak array object support.

Take a look at StandardFileStream class category registery
see the register:, registry, unregister:

Also see on the finalize instance side category
actAsExecutor if you are making copies of your object
and finalize which is what your object gets when finalized.
This *might* get called twice...
Plus see unregister & register.

In your finalize routine I'd suspect you would close/delete the file in  
question.

Note that finalization occurs later where later can be milliseconds to  
minutes base how where the object dies, young space, or old space.

On Nov 7, 2003, at 2:11 PM, Stéphane Rollandin wrote:

>
> hello list,
>
> I have objects referencing temporary files. I would like those files  
> to be deleted from the drive when the associated object gets  
> garbage-collected. How should I proceed ? How is an object informed  
> that it is about to be discarded ?
>
>
> Stef
>
>
>
>
--
======================================================================== 
===
John M. McIntosh <johnmci at smalltalkconsulting.com> 1-800-477-2659
Corporate Smalltalk Consulting Ltd.  http://www.smalltalkconsulting.com
======================================================================== 
===




More information about the Squeak-dev mailing list