title: Why should we call SuppressFinalize when we don't have a destructor
body: <p>I have few Question for which I am not able to get a proper answer .</p>
  
  <p>1) Why should we call SuppressFinalize in the Dispose function when we don't have a destructor .</p>
  
  <p>2) Dispose and finalize are used for freeing resources before the object is garbage collected. Whether it is managed or unmanaged resource we need to free it , then why we need a condition inside the dispose function , saying pass 'true' when we call this overridden function from IDisposable:Dispose and pass false when called from a finalize.</p>
  
  <p>See the below code I copied from net.</p>
  
  <pre><code>class Test : IDisposable
     {
       private bool isDisposed = false;
  
       ~Test()
       {
         Dispose(false);
       }
  
       protected void Dispose(bool disposing)
       {
         if (disposing)
         {
           // Code to dispose the managed resources of the class
         }
         // Code to dispose the un-managed resources of the class
  
         isDisposed = true;
       }
  
       public void Dispose()
       {
         Dispose(true);
         GC.SuppressFinalize(this);
       }
     }
  </code></pre>
  
  <p>what if I remove the boolean protected Dispose  function and implement the as below.</p>
  
  <pre><code>   class Test : IDisposable
     {
       private bool isDisposed = false;
  
       ~Test()
       {
         Dispose();
       }
  
  
       public void Dispose()
       {
        // Code to dispose the managed resources of the class
        // Code to dispose the un-managed resources of the class
        isDisposed = true;
  
        // Call this since we have a destructor . what if , if we don't have one 
         GC.SuppressFinalize(this);
       }
     }       
  </code></pre>