Closed
Bug 1277405
Opened 8 years ago
Closed 8 years ago
Places observers cause a shutdown leak when there are reference cycles
Categories
(Toolkit :: Places, defect)
Toolkit
Places
Tracking
()
RESOLVED
FIXED
mozilla49
Tracking | Status | |
---|---|---|
firefox49 | --- | fixed |
People
(Reporter: kmag, Assigned: kmag)
References
Details
Attachments
(1 file)
nsNavHistory and nsNavBookmarks don't implement cycle collection, so if there are any reference cycles between observers and the services themselves, we get a shutdown leak and crash. This currently happens if any global which references the download service also has a live downloads observer, since the download service registers a history observer for the lifetime of the process.
Assignee | ||
Comment 1•8 years ago
|
||
Review commit: https://reviewboard.mozilla.org/r/57020/diff/#index_header See other reviews: https://reviewboard.mozilla.org/r/57020/
Attachment #8758938 -
Flags: review?(mak77)
Comment 2•8 years ago
|
||
Please just do this where we set mCanNotify to false (we wouldn't notify from that point on...) Also please make addObserver throw if mCanNotify is false...
Comment 3•8 years ago
|
||
Comment on attachment 8758938 [details] Bug 1277405: Clear Places observers at XPCOM shutdown. https://reviewboard.mozilla.org/r/57020/#review53912
Attachment #8758938 -
Flags: review?(mak77)
Assignee | ||
Comment 4•8 years ago
|
||
(In reply to Marco Bonardo [::mak] from comment #2) > Please just do this where we set mCanNotify to false (we wouldn't notify > from that point on...) > Also please make addObserver throw if mCanNotify is false... I was assuming there was a reason that they weren't cleared at that point (namely preventing removeObserver from throwing if observers were cleared to early), but I'll do a full try run and see if it causes any problems.
Assignee | ||
Comment 5•8 years ago
|
||
Comment on attachment 8758938 [details] Bug 1277405: Clear Places observers at XPCOM shutdown. Review request updated; see interdiff: https://reviewboard.mozilla.org/r/57020/diff/1-2/
Attachment #8758938 -
Attachment description: MozReview Request: Bug 1277405: Clear Places observers at XPCOM shutdown. r?mak → Bug 1277405: Clear Places observers at XPCOM shutdown.
Attachment #8758938 -
Flags: review?(mak77)
Assignee | ||
Comment 6•8 years ago
|
||
Well, it didn't seem to cause any problems on try
Updated•8 years ago
|
Attachment #8758938 -
Flags: review?(mak77) → review+
Comment 7•8 years ago
|
||
Comment on attachment 8758938 [details] Bug 1277405: Clear Places observers at XPCOM shutdown. https://reviewboard.mozilla.org/r/57020/#review54320 Thanks, it looks good!
Assignee | ||
Comment 8•8 years ago
|
||
https://hg.mozilla.org/integration/fx-team/rev/0e6dfa8fc2f4d513dba9f434fc3a92c32e6b9ad6 Bug 1277405: Clear Places observers at XPCOM shutdown. r=mak
Comment 9•8 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/0e6dfa8fc2f4
Status: NEW → RESOLVED
Closed: 8 years ago
status-firefox49:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla49
You need to log in
before you can comment on or make changes to this bug.
Description
•