I have read in MSDN that is require to Unsubscribing every events an object has to be able to dispose it from memory. I always used -= to remove all references to event inside my object (like MSDN show).
Now, I have to maintain code and it has some memory leak on it. I see that the previous developer simply set the object that has all events subscribes on it to NULL and do not -= every event method.
Example:
_watcher.Changed += new ...
_watcher.Created += new ...
_watcher.Deleted += ..
//later.
_watcher = NULL;
Is it a good way or does it keeps the variable in memory?