title: EventHandlers and C# Classes destructor/Dispose
body: <p>I'm a bit confused about C# Classes and their deconstructor.</p>
  
  <p>I have to consume a few event handlers in a class instance I'm getting in the constructor:</p>
  
  <pre><code> public Foo(IFooHandler handler)
   {
       handler.Load += Load;
       handler.Close += Close;
   }
  </code></pre>
  
  <p>I need to unsubscribe to that event when the Foo class is destroyed. Do I implement <code>IDisposable</code> and unsubscribe in there, or in a deconstructor? I need to consume those events, I can't do it another way.</p>
  
  <p>For one of the classes, I create an instance, check progress, and then the class instance goes out of scope. For another it stays in the <code>MainForm</code> until the form is closed. The first is what I'm worried about because it may still have a reference to that event handler and not properly go.</p>
  
  <p>I don't want to leak memory. When and how should I unsubscribe?</p>