I'm reading "The C# Language", 4th Edition, it talks about garbage collection as below:
"BILL WAGNER: The following rule is an important difference between C# and other managed environments.
Prior to an application’s termination, destructor's for all of its objects that have not yet been garbage collected are called, unless such cleanup has been suppressed (by a call to the library method GC.SuppressFinalize, for example)."
So I have a couple of questions here:
Q1. Why .net is different from other managed environments (I suppose this is hinting Java?) here? Any particular design concern?
Q2. What will happened to objects that
GC.SuppressFinalizeis called? I understand that this means GC will not call such objects' finalizer (destructor), if so, when will these objects got really destroyed, so that the allocated memory bits are returned to the heap? Otherwise there'll be Memory Leak?