title: When and where to call the RemoveHandler in VB.NET?
body: <p>I am working to a VB.NET windows forms projet in .NET 1.1. And I have this type of architecture, very simplified.</p>
  
  <pre><code>Public MustInherit Class BaseTestLogic
  
    Private _TimerPoll As Timer
  
    Public Sub New(ByVal sym As SymbolFileMng, ByVal cfg As LampTestConfig, ByVal daas As DaasManager, ByVal mcf As Elux.Wg.Lpd.MCFs.VMCF)
  
      AddHandler _TimerPoll.Tick, AddressOf TimerPoll_Tick
  
    End Sub
  
  End Class
  
  Public Class SpecificTestLogic
    Inherits BaseTestLogic      
  
  End Class
  </code></pre>
  
  <p>Depending of the type of test I am doing I create an instance of a specific test derived from <strong>BaseTestLogic</strong>. But I found that after hundreds of object creations I can have <strong>StackOverflow</strong> exception. </p>
  
  <p>I checked my code and saw that I forgot to <strong>remove the handler</strong> to Timer Tick. The question is, where and when is it correct to remove hadler?</p>
  
  <p>Do I need to implement the <strong>IDisposable</strong> interface in the base class and RemoveHandler in <strong>Dispose</strong>?</p>