Re: Destructors are useless?
- From: "Michi Henning" <michi@xxxxxxxxxxx>
- Date: Thu, 28 Apr 2005 09:22:17 +1000
"Mattias Sjögren" <mattias.dont.want.spam@xxxxxxxx> wrote in message
news:%23kp1NX3SFHA.2128@xxxxxxxxxxxxxxxxxxxxxxx
>
> If that's the behavior you want, how about
>
> ~SomeClass()
> {
> if ( !Environment.HasShutdownStared ) {
> Debug.Assert( ... );
> }
> }
Unfortunately, I don't see how I can make that thread-safe --
HasShutDownStarted may change value half-way through
the execution of some finalizer.
Cheers,
Michi.
--
Michi Henning Ph: +61 4 1118-2700
ZeroC, Inc. http://www.zeroc.com
.
- Follow-Ups:
- Re: Destructors are useless?
- From: Helge Jensen
- Re: Destructors are useless?
- References:
- Destructors are useless?
- From: Michi Henning
- Re: Destructors are useless?
- From: Tom Porterfield
- Re: Destructors are useless?
- From: Michi Henning
- Re: Destructors are useless?
- From: Mattias Sjögren
- Destructors are useless?
- Prev by Date: Re: Closing database connections in a class destructor
- Next by Date: Re: Closing database connections in a class destructor
- Previous by thread: Re: Destructors are useless?
- Next by thread: Re: Destructors are useless?
- Index(es):
Relevant Pages
|