help-smalltalk
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Help-smalltalk] Is there a hook (a method) which is called, if the


From: Paolo Bonzini
Subject: Re: [Help-smalltalk] Is there a hook (a method) which is called, if the vm ends?
Date: Thu, 02 Jul 2009 15:09:10 +0200
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1b3pre) Gecko/20090513 Fedora/3.0-2.3.beta2.fc11 Lightning/1.0pre Thunderbird/3.0b2

On 07/02/2009 02:39 PM, Joachim Jaeckel wrote:
Hello,

'finalize' is called, if the object will be garbage collected. But is
there also a method, or exist a hook, that a method could be called, if
the vm ends?

I want to close my open files in a method of my object and write a last
message into the files, before the vm ends.

Files are closed automatically.

However, you can use

ObjectMemory addDependent: self.

and then "self" will get a bunch of events dispatched via the #update: method. grep "update:" in kernel/*.st for an example of its usage.

Paolo




reply via email to

[Prev in Thread] Current Thread [Next in Thread]