Hi Alex, Here what I understood: o := Object new. WeakRegistry default add: o. "a shallow copy of o is registered" o := nil. Smalltalk garbageCollect. "the shallow copy of o will receive the finalize message" Cheers, #Luc 2011/8/26 Alex Schenkman <alex@schenkman.info>
Let's see if I get this right:
obj := Object new. objExecutor := obj executor. obj := nil. Smalltalk garbageCollect.
Will this execute the method finalize on objExecutor? Is this the way to use it?
Thanks!
On Friday, August 26, 2011 at 5:53 PM, Igor Stasenko wrote:
On 26 August 2011 16:29, Alex Schenkman <alex@schenkman.info> wrote:
Hi List: Is there a method being called right befire an object is being garbage collected (finalized)? I see toFinalizeSend: to: with:, but I do not see any senders. thanks in advance!
Squeak finalization is a post-mortem finalization. The #finalize message are sent to executor object, which is often a shallow copy of the object which is died.
-- Best regards, Igor Stasenko AKA sig.