Closed Bug 474988 Opened 16 years ago Closed 15 years ago

Mismatched adds and removes of install listeners will fail

Categories

(Toolkit :: Add-ons Manager, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla1.9.2a1

People

(Reporter: mossop, Assigned: mossop)

Details

(Keywords: memory-leak)

Attachments

(1 file, 2 obsolete files)

If calls to removeInstallListenerAt aren't in the exact opposite order to the calls to addInstallListener then we'll remove the wrong install listener and in some cases end up keeping references to install listeners we shouldn't leading to memory leaks.
Attached patch patch rev 1 (obsolete) — Splinter Review
This is kind of lame but I can't see anything particularly easier without changing the API.
Attachment #358396 - Flags: review?(robert.bugzilla)
Attached patch now with added tests (obsolete) — Splinter Review
Forgot about these
Attachment #358396 - Attachment is obsolete: true
Attachment #358404 - Flags: review?(robert.bugzilla)
Attachment #358396 - Flags: review?(robert.bugzilla)
Comment on attachment 358404 [details] [diff] [review]
now with added tests

Actually I want to add some exception protection around these calls too.
Attachment #358404 - Attachment is obsolete: true
Attachment #358404 - Flags: review?(robert.bugzilla)
Attached patch patch rev 2Splinter Review
This adds a helper method for calling the listeners to simplify things a bit. Each call is wrapped with exception handling to prevent a listener from breaking the EM or other listeners.
Attachment #358829 - Flags: review?(robert.bugzilla)
Attachment #358829 - Flags: review?(robert.bugzilla) → review+
Status: NEW → ASSIGNED
Pushed: http://hg.mozilla.org/mozilla-central/rev/501b9c8c2f2b
Status: ASSIGNED → RESOLVED
Closed: 15 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla1.9.2a1
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: