1. Finalize is different from Dispose. Finalize is like a destructor, while
Dispose is like a Free() call (sort of)
2. The garbage collector will not call the Dispose method
3. Not every object supports Dispose. Any class that implements IDisposable
will support it.
4. Yes, you need to call it manually (or use the "using" keyword, in which
case the compiler will generate code to call Dispose)
Dispose is where you would free up any resource that you are hanging on to.
That would be a good place to close files or close any Database connections
you have open. Not every object needs it.
-vj
"aaj" <aa*@aaj.com> wrote in message
news:1115968104 .9b46c80adea689 3baec8ff88f2232 3aa@teranews...
Hi
can anyone point to a good link explaining (simply) when I should use the
dispose method.
Sort of things I'd like to know are
how does it differ from finalize in VB.net (or is it nothing like
finalize)
Does the garbage collector automatically call the dispose method when an
object goes out of scope.
Does every object support it, if not, which do
Does it have to be called manually for every object that does support it
...
this sort of thing
thanks
Andy