title: NullReferenceException occuring in System.Windows.Forms.Timer tick event
body: <p>I have a simple class with two variables and a Close function which is called from OnTimerTick. On very rare occasions a NullReferenceException is occurring in Close() function, but I fail to understand what those occasions can be. Can somebody explain?</p>
  
  <pre><code>System.Windows.Forms.Timer timer = new Timer();
  //timer.Tick is wired up in Constructor to OnTimerTick
  
  private void OnTimerTick(object sender, EventArgs e)
  {
      timer.Tick -= OnTimerTick;
      Close();
  }
  
  private void Close()
  {
      if (varOne != null)
      {
          varOne.SomeEvent -= onSomeEvent;
          varOne.Dispose();
          varOne = null;
      }
  
      if (varTwo != null)
      {
          varTwo.AnotherEvent -= onAnotherEvent;
          varTwo.Dispose();
          varTwo = null;
      }
  }
  </code></pre>