Closed
Bug 770598
Opened 13 years ago
Closed 13 years ago
Clean up NS_NewSVGDocument()
Categories
(Core :: SVG, defect)
Tracking
()
RESOLVED
FIXED
mozilla16
People
(Reporter: dholbert, Assigned: dholbert)
Details
Attachments
(1 file)
889 bytes,
patch
|
jwatt
:
review+
|
Details | Diff | Splinter Review |
decoder was just asking me about some unused-by-tests code in nsSVGDocument.cpp, and one of the lines for checking the result of "new" in NS_NewSVGDocument().
I'm filing this bug on removing that and doing a bit of other fixup in that function (using a nsRefPtr rather than a manual ADDREF / RELEASE)
Assignee | ||
Comment 1•13 years ago
|
||
This matches the pattern that we use in NS_NewSVG##_elementName##Element(), with nsRefPtr etc.:
http://mxr.mozilla.org/mozilla-central/source/content/svg/content/src/nsSVGElement.h?mark=584-602#581
The only difference is that I removed the null-check after "new", since it's infallible.
Attachment #638810 -
Flags: review?
Assignee | ||
Updated•13 years ago
|
Attachment #638810 -
Flags: review? → review?(longsonr)
![]() |
||
Comment 2•13 years ago
|
||
Comment on attachment 638810 [details] [diff] [review]
fix
longsonr is on vacation for a few weeks, so taking review.
Attachment #638810 -
Flags: review?(longsonr) → review+
Assignee | ||
Comment 3•13 years ago
|
||
Target Milestone: --- → mozilla16
Comment 4•13 years ago
|
||
Comment on attachment 638810 [details] [diff] [review]
fix
Review of attachment 638810 [details] [diff] [review]:
-----------------------------------------------------------------
::: content/svg/document/src/nsSVGDocument.cpp
@@ +112,4 @@
> return rv;
> }
>
> + *aInstancePtrResult = doc.forget().get();
Exactly what doc.forget(aInstancePtrResult) is for
Assignee | ||
Comment 5•13 years ago
|
||
Ah, nice -- I thought there was something like that. (FWIW, I was copypasting an existing pattern, for maximum foolproof-ness, as noted in comment 1.)
Probably worth doing an MXR search for "forget().get()" and replacing with forget(). Ms2ger, perhaps you'd be interested in filing and either fixing or mentoring? :)
Comment 6•13 years ago
|
||
Status: ASSIGNED → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•