Closed Bug 881468 Opened 6 years ago Closed 6 years ago

Event listener not properly removed in BrowserTabList

Categories

(DevTools :: General, defect)

x86
macOS
defect
Not set

Tracking

(Not tracked)

RESOLVED FIXED
Firefox 24

People

(Reporter: Fallen, Assigned: Fallen)

References

Details

Attachments

(1 file, 1 obsolete file)

http://hg.mozilla.org/mozilla-central/annotate/9ca690835a5e/toolkit/devtools/server/actors/webbrowser.js#l393

The addEventListener call has makeInfallible(handleLoad.bind(this)) passed, but the removeEventListener call just has handleLoad.

I would be happy to hear this has changed, but afaik the add and remove calls must have the same handler object passed to work correctly
Attached patch Fix - v1 (obsolete) — Splinter Review
Attachment #760582 - Flags: review?(jimb)
Blocks: tb-debugger
Attachment #760582 - Attachment is patch: true
Attachment #760582 - Attachment mime type: text/x-patch → text/plain
Attached patch Fix - v2Splinter Review
Better yet, use the new arrow functions I just read up on.
Attachment #760582 - Attachment is obsolete: true
Attachment #760582 - Flags: review?(jimb)
Attachment #760828 - Flags: review?(jimb)
Comment on attachment 760828 [details] [diff] [review]
Fix - v2

Review of attachment 760828 [details] [diff] [review]:
-----------------------------------------------------------------

Ah, thanks for finding and fixing this. Indeed, that code is bogus.
Attachment #760828 - Flags: review?(jimb) → review+
Whiteboard: [land-in-fx-team]
https://hg.mozilla.org/mozilla-central/rev/98b40ac6ed9a
Status: ASSIGNED → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Whiteboard: [fixed-in-fx-team]
Target Milestone: --- → Firefox 24
Product: Firefox → DevTools
You need to log in before you can comment on or make changes to this bug.