Closed
Bug 1153267
Opened 9 years ago
Closed 9 years ago
don't NS_ADDREF outparams when we can use smart pointers instead
Categories
(Core :: General, defect)
Core
General
Tracking
()
RESOLVED
FIXED
mozilla40
Tracking | Status | |
---|---|---|
firefox40 | --- | fixed |
People
(Reporter: froydnj, Assigned: froydnj)
Details
Attachments
(2 files)
57.43 KB,
patch
|
ehsan.akhgari
:
review+
|
Details | Diff | Splinter Review |
6.43 KB,
patch
|
ehsan.akhgari
:
review+
|
Details | Diff | Splinter Review |
No description provided.
Assignee | ||
Comment 1•9 years ago
|
||
If we're already holding something in a smart pointer, there's no need to NS_ADDREF it on the way out, we can just .forget() into the outparam.
Attachment #8590878 -
Flags: review?(ehsan)
Assignee | ||
Comment 2•9 years ago
|
||
This cleans up several easy-to-handle usages of NS_ADDREF'ing raw pointers into outparams by using smart pointers instead.
Attachment #8590879 -
Flags: review?(ehsan)
Comment 3•9 years ago
|
||
Comment on attachment 8590878 [details] [diff] [review] part 1 - use smart-pointer .forget() instead of NS_ADDREF+assign Review of attachment 8590878 [details] [diff] [review]: ----------------------------------------------------------------- ::: netwerk/streamconv/nsStreamConverterService.cpp @@ +550,2 @@ > rv = listener->AsyncConvertData(aFromType, aToType, aListener, aContext); > + listener.forget(_retval); Hmm, this changes the semantics of the code slightly, but hopefully that's ok...
Attachment #8590878 -
Flags: review?(ehsan) → review+
Updated•9 years ago
|
Attachment #8590879 -
Flags: review?(ehsan) → review+
Comment 4•9 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/3fb0310f5f49 https://hg.mozilla.org/mozilla-central/rev/d7d35bcd761d https://hg.mozilla.org/mozilla-central/rev/914fa009e6c7
Status: NEW → RESOLVED
Closed: 9 years ago
status-firefox40:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla40
You need to log in
before you can comment on or make changes to this bug.
Description
•