Any application shutdown hooks?

2011-05-25 Thread Matthew Ong
Hi, If I am writing a database library such as DSL, Data Service Layer, there is a need for me to do a good clean up for the connections/results sets/transactions that this library is currently handling. How ever, if another library/package somewhere else calls for a

Re: Any application shutdown hooks?

2011-05-25 Thread Steven Schveighoffer
http://www.digitalmars.com/d/2.0/class.html#StaticDestructor -Steve

Re: Any application shutdown hooks?

2011-05-25 Thread Matthew Ong
On 5/25/2011 11:13 PM, Steven Schveighoffer wrote: http://www.digitalmars.com/d/2.0/class.html#StaticDestructor -Steve Static Destructor maybe executed when the class is being unloaded GC? Because this is a class level. It is more like the application level exit and such. That is not

Re: Any application shutdown hooks?

2011-05-25 Thread Ali Çehreli
On 05/25/2011 08:35 AM, Matthew Ong wrote: On 5/25/2011 11:13 PM, Steven Schveighoffer wrote: http://www.digitalmars.com/d/2.0/class.html#StaticDestructor -Steve Static Destructor maybe executed when the class is being unloaded GC? Because this is a class level. It is more like the

Re: Any application shutdown hooks?

2011-05-25 Thread Steven Schveighoffer
On Wed, 25 May 2011 11:35:51 -0400, Matthew Ong on...@yahoo.com wrote: On 5/25/2011 11:13 PM, Steven Schveighoffer wrote: http://www.digitalmars.com/d/2.0/class.html#StaticDestructor -Steve Static Destructor maybe executed when the class is being unloaded GC? Because this is a class level.

Re: Any application shutdown hooks?

2011-05-25 Thread Steven Schveighoffer
On Wed, 25 May 2011 11:50:16 -0400, Ali Çehreli acehr...@yahoo.com wrote: On 05/25/2011 08:35 AM, Matthew Ong wrote: On 5/25/2011 11:13 PM, Steven Schveighoffer wrote: http://www.digitalmars.com/d/2.0/class.html#StaticDestructor -Steve Static Destructor maybe executed when the class is

Re: Any application shutdown hooks?

2011-05-25 Thread Matthew Ong
On 5/25/2011 11:52 PM, Steven Schveighoffer wrote: If you want a static dtor that runs on every thread shutdown, use a normal static dtor. If you want one that runs on the entire application shutdown, use a shared static dtor. -Steve Module Destructor: Cool feature that I can consider to use

Re: Any application shutdown hooks?

2011-05-25 Thread Steven Schveighoffer
On Wed, 25 May 2011 11:52:14 -0400, Steven Schveighoffer schvei...@yahoo.com wrote: On Wed, 25 May 2011 11:35:51 -0400, Matthew Ong on...@yahoo.com wrote: On 5/25/2011 11:13 PM, Steven Schveighoffer wrote: http://www.digitalmars.com/d/2.0/class.html#StaticDestructor -Steve Static

Re: Any application shutdown hooks?

2011-05-25 Thread Andrej Mitrovic
On 5/25/11, Steven Schveighoffer schvei...@yahoo.com wrote: If you want a static dtor that runs on every thread shutdown, use a normal static dtor. If you want one that runs on the entire application shutdown, use a shared static dtor. I saw some commits change a static dtor to a shared

Re: Any application shutdown hooks?

2011-05-25 Thread Matthew Ong
On 5/26/2011 12:23 AM, Andrej Mitrovic wrote: On 5/25/11, Steven Schveighofferschvei...@yahoo.com wrote: If you want a static dtor that runs on every thread shutdown, use a normal static dtor. If you want one that runs on the entire application shutdown, use a shared static dtor. I saw some