G
Greg Patrick
Let's say I have a Form and I create a delegate (MyDelegate) and an event
(SomethingHappened) for that form.
Now other classes add their delegate to the event, e.g.
theForm.SomethingHappened += new MyDelegate(this.myMethod);
When I Close the form, how do I properly dispose of the delegates of the
event?
Does each subcriber need to do a -= ?
Or can I just put this.SomethingHappened = null in the Dispose(bool) of the
Form?
I want to make sure the subscribers don't still have a reference that would
prevent garbage collection of the form...
Greg Patrick
(SomethingHappened) for that form.
Now other classes add their delegate to the event, e.g.
theForm.SomethingHappened += new MyDelegate(this.myMethod);
When I Close the form, how do I properly dispose of the delegates of the
event?
Does each subcriber need to do a -= ?
Or can I just put this.SomethingHappened = null in the Dispose(bool) of the
Form?
I want to make sure the subscribers don't still have a reference that would
prevent garbage collection of the form...
Greg Patrick