S
Sean Malloy
Hi,
I'm new to windows forms development.
I'm just wondering what the best practise is to deatching events.
I have an external object which is passed into a dialog form. The dialog
wires up a couple of EventHandlers. to listen for events on the object.
Now I have a suspicion that even when I dispose of the form, it is still
hanging around and can't be garbage collected, because a delegate is still
pointing to it because it is still bound to events on another object.
Is this the case?
I've looked through a number of example applications, and I can't find any
examples of people actualy detaching their events once they're finished with
them.
What does everyone else do? Should I detach them, and if so, when?
I'm new to windows forms development.
I'm just wondering what the best practise is to deatching events.
I have an external object which is passed into a dialog form. The dialog
wires up a couple of EventHandlers. to listen for events on the object.
Now I have a suspicion that even when I dispose of the form, it is still
hanging around and can't be garbage collected, because a delegate is still
pointing to it because it is still bound to events on another object.
Is this the case?
I've looked through a number of example applications, and I can't find any
examples of people actualy detaching their events once they're finished with
them.
What does everyone else do? Should I detach them, and if so, when?