title: Using Dispose on a Singleton to Cleanup Resources
body: <p>The question I have might be more to do with semantics than with the actual use of <code>IDisposable</code>. I am working on implementing a singleton class that is in charge of managing a database instance that is created during the execution of the application.  When the application closes this database should be deleted.  </p>
  
  <p>Right now I have this delete being handled by a <code>Cleanup()</code> method of the singleton that the application calls when it is closing.  As I was writing the documentation for <code>Cleanup()</code> it struck me that I was describing what a <code>Dispose()</code> method should be used for i.e. cleaning up resources. I had originally not implemented <code>IDisposable</code> because it seemed out of place in my singleton, because I didn't want anything to dispose the singleton itself.  There isn't currently, but in the future might be a reason that this <code>Cleanup()</code> might be called but the singleton should will need to still exist.  I think I can include <code>GC.SuppressFinalize(this);</code> in the Dispose method to make this feasible. </p>
  
  <p>My question therefore is multi-parted: </p>
  
  <p>1) Is implementing <code>IDisposable</code> on a singleton fundamentally a bad idea?</p>
  
  <p>2) Am I just mixing semantics here by having a <code>Cleanup()</code> instead of a <code>Dispose()</code> and since I'm disposing resources I really should use a dispose?</p>
  
  <p>3) Will implementing 'Dispose()' with <code>GC.SuppressFinalize(this);</code> make it so my singleton is not actually destroyed in the case I want it to live after a call to clean-up the database.</p>