W3C home > Mailing lists > Public > www-dom@w3.org > July to September 2001

Re: [Events] removeEventListener on EventListeners currently being processed

From: Michael B. Allen <mballen@erols.com>
Date: Sat, 18 Aug 2001 20:17:35 -0400
To: Curt Arnold <carnold@houston.rr.com>
Cc: www-dom@w3.org
Message-ID: <20010818201735.A3466@nano.foo.net>
On Sat, Aug 18, 2001 at 12:17:20PM -0500, Curt Arnold wrote:
> > You're right there, that's what the spec currently says. But the spec is
> > wrong, though. It is meant to say the opposite.

Meaning an EventListener should be called even if another listener in
the list currently being processed removes it? I think the implementation
issue may become even more difficult in languanges with explicit memory
management though. Currently, my implementation frees a ListenerEntry
struct when removeEventListener is called. As is, this would result in
dereferencing a dangling pointer if dispatchEvent attempts to trigger a
listener after it has been removed. I suspect I must collect the pointers
to the actull functions to be called for each listener and store that
in an array (i.e. pre-dereference the listener functions).

I'm glad I asked.

Thanks Curt,

Wow a memory-mapped fork bomb! Now what on earth did you expect? - lkml
Received on Saturday, 18 August 2001 20:11:17 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 20 October 2015 10:46:09 UTC