Re: Destructors are useless?

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



"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

.



Relevant Pages

  • Re: doubt abt finalizer method
    ... >i heard grabase collector vll reclaim the space for nameless objects ... >immediately after execution.because no wa y after that stmt v can refer ... >stmt's execution it vll reclaim space.if this is correct the finalizer ... finalizer for class A has to be executed, but when I try it, I ...
    (comp.lang.java.programmer)
  • Re: Destructors are useless?
    ... > that a finalizer is almost completely useless. ... is be able to safely assert within a finalizer and, if the assertion fails, ... private someType _mem1; ... Michi. ...
    (microsoft.public.dotnet.languages.csharp)
  • VB.Net Code to read File Names
    ... So I'm looking for sample code that will instantiate MS Access (one that ... only exists during the execution of the VB.Net program) and read and input ... Mark ... Prev by Date: ...
    (microsoft.public.dotnet.languages.vb)
  • Re: blubberblubber
    ... SCNR ... Michi ... Prev by Date: ...
    (de.sci.chemie)
  • Re: Wie bringe ich den Dateinamen per Formel in Zelle?
    ... Ah, ZELLE, und ich hab mein Glück mit INFO versucht ... ... Danke ... Michi ... Prev by Date: ...
    (microsoft.public.de.excel)