G
Guest
When an object is register to event (delegate marked as event) with one of
its methods, what happen when the event is raised if the object is dead
(finalized)?
In this case the delegate invocation is trying to invoke a method on a null
object, this should generate en exception.
What exception is that?
Another question in this same issue:
If an object A is registered to an event on some other object B, and object
A is out of context, it should be finalized. BUT I see that because one of
its method is still registered to the event on object B, it's like object B
is still referencing object A. therefore object A is not being finalized even
if I expect it to.
Am I correct?
its methods, what happen when the event is raised if the object is dead
(finalized)?
In this case the delegate invocation is trying to invoke a method on a null
object, this should generate en exception.
What exception is that?
Another question in this same issue:
If an object A is registered to an event on some other object B, and object
A is out of context, it should be finalized. BUT I see that because one of
its method is still registered to the event on object B, it's like object B
is still referencing object A. therefore object A is not being finalized even
if I expect it to.
Am I correct?