Consider this class:
Class Item : Inherits ItemBase
Public Sub New
AddHandler MyEvent, AddressOf MyEventHandler
End Sub
Private Sub MyEventHandler()
End Sub
Private Sub MySecondEventHandler() Handles MyBase.MyEvent
End Sub
End Class
Do I have to manually remove the handlers on destruction of this item?? isn't this done by the GC or other tool of the managed-code compiler?
If your object is marked as dead that means there are no references to it and its internal references are now from dead object and do not matter from this point. So you don't have to remove the handlers manually.