> Just to be clear though, if I find they are *not* all being removed, I > should open a bug on that rather than just removing the listeners myself and > calling it done? ie, is it accurate to say that it *should* not be > necessary to remove these handlers (and, if I verify that is true, that I > could explicitly add a note to this effect on the relevant MDN pages?)
You'd have to ask smaug to be sure, but judging from what I looked at, I'd think that we are trying to remove the event listeners when the relevant window and/or goes away. So I'd file a bug; we can always resolve it as invalid. >> [1] https://bug893242.bugzilla.mozilla.org/attachment.cgi?id=774978 >> >> On Thu, Jul 25, 2013 at 6:51 PM, Mark Hammond <[email protected]> >> wrote: >>> >>> Felipe and I were having a discussion around a patch that uses >>> nsIMessageManager. Specifically, we create a <browser> element, then >>> call >>> browser.messageManager.addMessageListener() with the requirement that the >>> listener live for as long as the browser element itself. >>> >>> The question we had was whether it was necessary to explicitly call >>> removeMessageListener, or whether we can rely on automatic cleanup when >>> the >>> browser element dies? It seems obvious to us that it *should* be safe to >>> rely on automatic cleanup, but searching both docs and mxr didn't make it >>> clear, so I figured it was better to ask rather than to cargo-cult the >>> addition of explicit cleanup code that wasn't necessary. >>> >>> Thanks, >>> >>> Mark >>> _______________________________________________ >>> dev-platform mailing list >>> [email protected] >>> https://lists.mozilla.org/listinfo/dev-platform > > _______________________________________________ dev-platform mailing list [email protected] https://lists.mozilla.org/listinfo/dev-platform

