Closed
Bug 1287166
Opened 9 years ago
Closed 9 years ago
Use a little less NS_ADDREF in DOM code
Categories
(Core :: DOM: Core & HTML, defect)
Core
DOM: Core & HTML
Tracking
()
RESOLVED
FIXED
mozilla50
Tracking | Status | |
---|---|---|
firefox50 | --- | fixed |
People
(Reporter: mccr8, Assigned: mccr8)
Details
Attachments
(1 file)
2.66 KB,
patch
|
bkelly
:
review+
|
Details | Diff | Splinter Review |
No description provided.
Assignee | ||
Comment 1•9 years ago
|
||
Attachment #8772561 -
Flags: review?(bkelly)
Comment 2•9 years ago
|
||
Comment on attachment 8772561 [details] [diff] [review]
Use NS_ADDREF less in dom/.
Review of attachment 8772561 [details] [diff] [review]:
-----------------------------------------------------------------
r=me with comments addressed.
::: dom/base/nsGenericDOMDataNode.h
@@ +172,5 @@
>
> virtual nsresult Clone(mozilla::dom::NodeInfo *aNodeInfo, nsINode **aResult) const override
> {
> + nsCOMPtr<nsINode> result = CloneDataNode(aNodeInfo, true);
> + if (!result) {
The previous code had the side effect of clearing *aResult when CloneDataNode() returned nullptr. It would be slightly safer to put the forget() before the short-circuit here. If you are sure it doesn't matter, though, then this is fine.
Attachment #8772561 -
Flags: review?(bkelly) → review+
Assignee | ||
Comment 3•9 years ago
|
||
That's a good point. I'll do that.
Pushed by amccreight@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/bf7983226fbe
Use NS_ADDREF less in dom/. r=bkelly
Comment 5•9 years ago
|
||
bugherder |
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla50
Updated•6 years ago
|
Component: DOM → DOM: Core & HTML
You need to log in
before you can comment on or make changes to this bug.
Description
•