> > Is there a way to determine if an object has been finalized? I figured
> > you'd ask the GC somehow - but I can't see a method for doing this.
[quoted text clipped - 8 lines]
> If you have a reference to the object, then it hasn't been finalized
> (unless it's been resurected, but that's another story).
Not true - you could have a reference to it and you're being finalized
as well.

Signature
Jon Skeet - <skeet@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
David Browne - 03 Dec 2004 15:16 GMT
>> > Is there a way to determine if an object has been finalized? I figured
>> > you'd ask the GC somehow - but I can't see a method for doing this.
[quoted text clipped - 11 lines]
> Not true - you could have a reference to it and you're being finalized
> as well.
Aah, which, of course, is probably the only time you would care if another
object has already been finalized.
David
Phil Jones - 05 Dec 2004 02:22 GMT
Very interesting - thanks guys.
Mike Blake-Knox - 05 Dec 2004 16:48 GMT
> Aah, which, of course, is probably the only time you would care if another
> object has already been finalized.
Is there another way to obtain a count of the unfinalized (un garbage
collected would be better) instances of a class? (I've inherited some
software that had put finalizers and destructors in place purely so that
performance monitoring counters could be generated.) I removed this when we
started having memory problems.
Thanks
Mike
David Levine - 05 Dec 2004 23:57 GMT
You would have to do this yourself - the runtime does not track instances,
only whether or not the object is reachable or not.
>> Aah, which, of course, is probably the only time you would care if
>> another
[quoted text clipped - 10 lines]
>
> Mike