title: How do events cause memory leaks in C# and how do Weak References help mitigate that?
body: <p>There are two ways (that I know of) to cause an unintentional memory leak in C#:</p>
  
  <ol>
  <li>Not disposing of resources that implement <code>IDisposable</code></li>
  <li>Referencing and de-referencing events incorrectly.</li>
  </ol>
  
  <p>I don't really understand the second point.  If the source object has a longer lifetime than the listener, and the listener doesn't need the events anymore when there are no other references to it, using normal .NET events causes a memory leak: the source object holds listener objects in memory that should be garbage collected.</p>
  
  <p>Can you explain how events can cause memory leaks with code in C#, and how I can code to get around it using Weak References and without Weak References?</p>