[squeak-dev] Re: Best practice(s) to delete an object?

John M McIntosh johnmci at smalltalkconsulting.com
Wed Feb 27 04:38:42 UTC 2008


Ok, well in the finalization you can broadcast to everyone who had an  
interest that the object has died.
Some system signal using the proxy cloned object.

An example in sophie is where the storage subsystem instance is  
deleted, the proxy then ensure any files are closed and temp
files deleted, and notifies the Memory based storage subsystem any  
cached streams for this particular storage subsystem can be deleted.

A pattern used is to register interest in an object, then on  
finalization sending I'm dead messsage to those interested parties.

I'll let someone else give details. usually the ugly thing with this  
register/free pattern is someone forgets to send the free message or  
super free etc.
Then although you *know* you've *deleted* that object you find you  
have 10,000 of them lurking one friday afternoon usually before a  
holiday.


On Feb 26, 2008, at 8:22 PM, itsme213 wrote:

> "Sebastian Sastre" <ssastre at seaswork.com> wrote
>
>> But for the rest of common objects references in the image you just
>> abandon them
>> and they will GC'd automagically.
>
> I did not phrase my first question clearly, sorry. My problem is not  
> about
> reclaiming the "deleted" object, but about making sure no other  
> objects
> behave (visibly) as though they still had references to it.
>
> Thanks - Sophie

--
= 
= 
= 
========================================================================
John M. McIntosh <johnmci at smalltalkconsulting.com>
Corporate Smalltalk Consulting Ltd.  http://www.smalltalkconsulting.com
= 
= 
= 
========================================================================





More information about the Squeak-dev mailing list