G
Guest
If you call AddHandler and hook events of one object to a method in a class
will the event source object still be available for garbage collection if the
original reference is set to Nothing? Or do you have to call RemoveHandler
as well?
For example: I am using the ActiveX version of the WebBrowser control. In
the DocumentComplete event I set up my event handlers for the Document object
loaded by the browser. Do I have to call RemoveHandler every time I load a
new document so the original document will be free to be garbage collected?
I guess I am confused on what referencing occurs when you use AddHandler. I
couldn't find a good explanation on it in the MSDN Help. (I am sure it is
there somwhere). Any links are appreciated.
Thanks,
John
will the event source object still be available for garbage collection if the
original reference is set to Nothing? Or do you have to call RemoveHandler
as well?
For example: I am using the ActiveX version of the WebBrowser control. In
the DocumentComplete event I set up my event handlers for the Document object
loaded by the browser. Do I have to call RemoveHandler every time I load a
new document so the original document will be free to be garbage collected?
I guess I am confused on what referencing occurs when you use AddHandler. I
couldn't find a good explanation on it in the MSDN Help. (I am sure it is
there somwhere). Any links are appreciated.
Thanks,
John