Re: Destructors are useless?
- From: "Michi Henning" <michi@xxxxxxxxxxx>
- Date: Thu, 28 Apr 2005 07:17:51 +1000
"Dilip" <rdilipk@xxxxxxxxx> wrote in message
news:1114618817.251793.164600@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
> Ok -- so how about this:
>
> class someclass
> {
> ~someclass()
> {
> try
> {
> System.Diagnostics.Assert(_myMemVar == null);
> }
> catch(ObjectDisposedException)
> {
> // you can't do much here anyway
> }
> }
> }
No, don't think so. Under Mono, the code crashes with a NullPointerException
if the assertion fails somewhere inside the assert. A far as I can see, the
problem
is that, by the time my finalizer runs, stdout and stderr have been closed
already
and further calls to assert crash the process.
Cheers,
Michi.
--
Michi Henning Ph: +61 4 1118-2700
ZeroC, Inc. http://www.zeroc.com
.
- Follow-Ups:
- Re: Destructors are useless?
- From: Dmytro Lapshyn [MVP]
- 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: Dilip
- Destructors are useless?
- Prev by Date: Re: creating bitmap
- Next by Date: Re: Weird Valuetype behavior
- Previous by thread: Re: Destructors are useless?
- Next by thread: Re: Destructors are useless?
- Index(es):