Closed
Bug 1412726
Opened 7 years ago
Closed 7 years ago
Clean up XPCOM singleton constructor refcount handling
Categories
(Core :: XPCOM, enhancement)
Core
XPCOM
Tracking
()
RESOLVED
FIXED
mozilla59
Tracking | Status | |
---|---|---|
firefox59 | --- | fixed |
People
(Reporter: kmag, Assigned: kmag)
References
Details
Attachments
(1 file)
This is a follow-up to bug 1409249. There are a lot of places where our factory singleton constructors either don't correctly handle their returned references being released by the component manager, or do handle it, but in ways that are not obvious.
This patch handles a few places where we can sometimes wind up with dangling singleton pointers, adds some explanatory comments and sanity check assertions, and replaces some uses of manual refcounting with StaticRefPtr and ClearOnShutdown.
There are still some places where we may wind up with odd behavior if the first QI for a getService call fails, and we wind up destroying the first instance of a service that we create, and re-creating a new one later.
Comment hidden (mozreview-request) |
Comment 2•7 years ago
|
||
mozreview-review |
Comment on attachment 8923230 [details]
Bug 1412726: Clean up XPCOM singleton constructor refcount handling.
https://reviewboard.mozilla.org/r/194390/#review216276
Sorry for taking so long to review this. This all seems very reasonable.
Attachment #8923230 -
Flags: review?(nfroyd) → review+
Assignee | ||
Comment 3•7 years ago
|
||
https://hg.mozilla.org/integration/mozilla-inbound/rev/8357c080dccbe4c6aaba3d9e012b3262f45ff7f6
Bug 1412726: Clean up XPCOM singleton constructor refcount handling. r=froydnj
Comment 4•7 years ago
|
||
bugherder |
Status: NEW → RESOLVED
Closed: 7 years ago
status-firefox59:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla59
You need to log in
before you can comment on or make changes to this bug.
Description
•