Hi Willy,
I said (shortened)
|| If two objects reference each other and nothing else does,
the
|| pair will wait together for the program to terminate.
Ron asked me if I'm sure. No. I was when I first learned this stuff. If
it's now wrong - great, we have a better GC. I prefer to write my code
as if the GC is dumb in this respect - it feels cleaner.
You asked what I meant by "freed". I'm talking about managed objects and
mean that they are unreferenced. I'm not talking about system resources,
memory, etc.
You said
|| Releasing unmanaged resources is somewhat more complicated than
simply setting a reference to null.
My post starts with the line:
|| In a nutshell -
The post is introductory and intended to be read as a list of bullets -
not full-on explanations. However, it would have been better if I'd implied
that there's more to it.
The article that Michael mentioned,
http://msdn.microsoft.com/msdnmag/issues/1100/gci/, written by Jeffrey
Richter, is excellent and goes into lots of detail about garbage collection,
especially Finalization, - but suprisingly little about your point
(unmanaged resources). I think you should do a short post to explain further
and give examples, Willy. Go for it. ;-)
Regards,
Fergus
ps. In part 2 of the article there's a link to Figure 1 which uses
JavaScript. It failed on my machine. If it fails for you too, the full link
is
http://msdn.microsoft.com/msdnmag/issues/1200/GCI2/figures.asp.