Re: Maintain list of attached event handlers (.Net 1.1)



On Tue, 10 Jul 2007 20:34:48 -0700, Armin Zingler <az.nospam@xxxxxxxxxx> wrote:

Why do you insist on doing extra work by detaching event handlers that have
already been detached before?

It's not extra work. It's _less_ work.

Why keep listening to events that will never occur?

Having a delegate attachd to an event is not "listening". It incurs zero performance penalty. Zero. If the memory cost is unacceptable after the event has been raised, then it was unacceptable before it was raised. The question of removing the delegate or not is a red herring. And leaving the delegate subscribed does not involve any execution overhead whatsoever.
.


Loading