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

Sebastian Sastre ssastre at seaswork.com
Wed Feb 27 02:46:10 UTC 2008


> >  I suspect I am missing far more elegant solutions.
> >
> >  All pointers :-) appreciated.
> >
> If you raised this question, i think you missed something in design of
> your app. That's the whole point of automatic memory management: you
> should not care how many references point to particular object. GC
> cares for you.
> 
> -- 
> Best regards,
> Igor Stasenko AKA sig.
> 
I agree with Igor. You will do care a little more only when an object has to release a resource. Like views, sockets or files. Anything with handlers taken from the OS should "shutdown" somehow so the resource is free a lot before CG claim that instance. But for the rest of common objects references in the image you just abandon them and they will GC'd automagically.

Cheers,

Sebastian




More information about the Squeak-dev mailing list