Clean up method like #exiting from VAST

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Clean up method like #exiting from VAST

vince

Hello

 

In VAST there is a class-side method #exiting which can be implemented in an application and is called just before the image is shut down. I use it to typically implement clean-up code.

 

Is there something similar in Pharo?

 

If I use aBlock ensure: cleanUpBlock, is the cleanUpBlock guaranteed to run in what circumstances?

 

Vince

Reply | Threaded
Open this post in threaded view
|

Re: Clean up method like #exiting from VAST

Noury Bouraqadi-2
Hi Vince,

In Pharo there is startup list that is used also when quitting (in reverse upon shutdown).

To register a class :
Smalltalk addToStartUpList: aClass

The class startup behavior should go in class method
startUp: resumingBoolean

The class quit behavior should go in a class method
shutDown: quittingBoolean

Noury
--
Learn, Code & Make for the Planet




On 13 Mar 2020, at 07:02, Vince Refiti <[hidden email]> wrote:

Hello
 
In VAST there is a class-side method #exiting which can be implemented in an application and is called just before the image is shut down. I use it to typically implement clean-up code.
 
Is there something similar in Pharo? 
 
If I use aBlock ensure: cleanUpBlock, is the cleanUpBlock guaranteed to run in what circumstances?
 
Vince

Reply | Threaded
Open this post in threaded view
|

Re: Clean up method like #exiting from VAST

Erik Stel
In reply to this post by vince
Vince,

You could check SmalltalkImage>>#addToShutDownList:

Greetz,
Erik




--
Sent from: http://forum.world.st/Pharo-Smalltalk-Users-f1310670.html