don't NS_ADDREF outparams when we can use smart pointers instead

RESOLVED FIXED in Firefox 40

Status

()

defect
RESOLVED FIXED
4 years ago
4 years ago

People

(Reporter: froydnj, Assigned: froydnj)

Tracking

unspecified
mozilla40
Points:
---

Firefox Tracking Flags

(firefox40 fixed)

Details

Attachments

(2 attachments)

Assignee

Description

4 years ago
No description provided.
Assignee

Comment 1

4 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

4 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

4 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

4 years ago
Attachment #8590879 - Flags: review?(ehsan) → review+
You need to log in before you can comment on or make changes to this bug.