I am trying to unregister the event handler at the end of my program. It looks like this -
myobject.EventHandler -= new MyEventHandler(MyMethod);
Now, I noticed that under certain conditions this statement gets executed multiple times. The program seems to work as expected but I want to confirm that it is not doing something weird.
When the handler is unregistered the first time object.EventHandler is set to NULL. So is it ok to execute this statement any number of times?
Thanks