title: Detaching a null event handler
body: <p>I've been commissioned with cleaning up memory leaks in our code as well as placing checks to prevent further leaks.  I've noticed un-detached handlers seem to be the main cause.  Most are straight forward, but there are a couple things in code that have made me scratch my head.  </p>
  
  <p>First:</p>
  
  <p><code>myObject.someEvent -= null;</code></p>
  
  <p>Am I correct in assuming that does absolutely nothing?  (I know that if an event is local you can set it to null since it's essentially a multicast delegate).</p>
  
  <p>Second, for anonymous handlers:</p>
  
  <p><code>myObject.someEvent += ()=&gt; { x + y; };<br>
  myObject.someEvent -= ()=&gt; { x + y; };</code></p>
  
  <p>Am I correct in saying the second instruction is worthless as well since the anonymous methods will be compiled as two separate delegates and therefore the subtraction doesn't actually point to the correct handler that would need to be removed?  (For anyone looking for a proper solution to solve this, look <a href="https://stackoverflow.com/a/4303966/1265219">here</a>).</p>
  
  <p>I don't want to settle for "yeah, that's right", I want to know <strong>why</strong> these things don't work (assuming my assertions are correct).  </p>