IDisposable with managed code



If your class implements IDisposable, I was told that this increases the
speed with which your class is garbage collected. Is this true? And if so,
how much "time" does it save? Assume that we are dealing with 100% managed
code and that the clean-up is of big inmemory data structures.

Thanks in advance.

Mark


public void Dispose()
{
Dispose(true);
GC.SuppressFinalize(this);
}

protected virtual void Dispose(bool disposing)
{
if (disposing)
{
if (this.BigData != null)
{
this.BigData.Dispose();
}
}
}


.



Relevant Pages

  • Re: ReaderWriterLockSlim + Dispose?
    ... private int _cthread; ... public void test{ ... protected virtual void Dispose(bool disposing) {if ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: How can I call base interface method?
    ... > class MyClass:ThirdPartyClass, IDisposable { ... a "protected virtual void Dispose(bool disposing)" where the acctually ... class ThirdPartyClass:IDisposable ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: IDisposable with an abstract class?
    ... protected virtual void Dispose ... the boolean disposing value is going to ... to Clean Up Unmanaged Resources", located at: ... should I just implement the interface> IDisposable off of the two derived classes? ...
    (microsoft.public.dotnet.languages.csharp)
  • RE: Code Analysis - CA1816 (CallGCSuppressFinalize)
    ... A disposable type needs to implement IDisposable & provide a public ... then the finalizer calls Dispose. ... protected virtual void Dispose(bool disposing) ... protected virtual void Dispose{ ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: VS 2005: Dispose method Reserved
    ... public void Dispose() ... protected virtual void Dispose{ ... if(disposing) // Disposing ilustrates if we are in finalizer ...
    (microsoft.public.dotnet.languages.vc)