Re: [whatwg/dom] Owned weak event listener to prevent memory leak (using EventListenerOptions) (#243)

I like the idea of having the possibility to have weak listeners, it can be useful in some cases, but It can trick you into think it would prevent a leak, but in fact it would cause one.

Lets say you added a event on document to close a popup, and the you remove the popup from the DOM, the GB trashes the listener, this means the listener never gets called, but you used that listener to teardown your thing and maybe sub components, but now they will live forever as ghosts "components".

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/dom/issues/243#issuecomment-318668475

Received on Friday, 28 July 2017 14:35:29 UTC