Possible Duplicate:
Remove handlers on disposing object
I have some code which dynamically adds and removes Controls to/from a Form. The controls are stored in a collection owned by the form. When removing controls the code goes through and disposes of them as follows
if (node != null && !node.IsDisposed)
{
node.Resize -= docNode_Resize;
node.DocumentRefreshRequested -= docNode_DocumentRefreshRequested;
node.Dispose();
}
Is the removing of events part necessary? Seems like Dispose() is sufficient.
It was asked So many times.
No, you do not need that, unless: