Cleaning up eventhandlers
C#
1
Posts
1
Posters
0
Views
1
Watching
-
Hi all. I'm writing an application where I have a few forms linking up events to other form's methods. I have to manage this eventhandlers clean up to kill any reference I might have through the events when i close one of the forms. My first approach was calling a disposeEvents() method from the Dispose(bool dispose) method on each form and unlinking (-=) al eventhandlers. I was just wondering if this could be done by simply callinh myForm.Events.Dispose()? or is it better to do it as I have it right now and unlink one by one all eventhandlers that point to an object outside myForm? thnks.