D
Dmitriy Lapshin [C# / .NET MVP]
Hello everybody,
I have just been chatting with a colleague who is also an experienced .NET
programmer, and we have been discussing freeing memory by the GC in various
event handler scenarios (inspired by the "Freeing memory phobia" thread).
And what we've come up to is that event handler references could be made
weak references - meaning if the subscribed has been destroyed, it obviously
has no need to receive events anymore AND thus it would prevent the
receivers to be kept in memory just because they are subscribed to some
event.
What do you think?
I have just been chatting with a colleague who is also an experienced .NET
programmer, and we have been discussing freeing memory by the GC in various
event handler scenarios (inspired by the "Freeing memory phobia" thread).
And what we've come up to is that event handler references could be made
weak references - meaning if the subscribed has been destroyed, it obviously
has no need to receive events anymore AND thus it would prevent the
receivers to be kept in memory just because they are subscribed to some
event.
What do you think?