Re: Avoiding destructors while still calling atexit handlers
Re: Avoiding destructors while still calling atexit handlers
- Subject: Re: Avoiding destructors while still calling atexit handlers
- From: Brian Onn <email@hidden>
- Date: Sat, 7 Jan 2006 07:31:30 -0800
On Jan 6, 2006, at 3:15 PM, Steve Checkoway wrote:
I'm not sure why you want to avoid the dtors being called but it
might be simply easier to have a global flag that you set when you
are about to exit and do not want the dtors to do anything. Then,
in the dtor, just check if the flag is set or not before doing
whatever it is that is normally done there.
- Steve _______________________________________________
I would like to comment that I think Steve's suggestion is a much
more *maintainable* solution. Doing tricky things in the code, or
arranging static classes in a specific way to ensure that a specific
static destructor is called first *so that it can exit abruptly* is
just asking for trouble later on.
Testing a flag in a dtor is probably not going to win you any 3leet
awards :), but it is clear what you are doing, when and why.
---
Brian Onn
email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden