Closed Bug 1122991 Opened 5 years ago Closed 5 years ago

Mark findIndexOfClosure as stack class, and make its targetElement member a strong ref; r=froydnj

Categories

(Core :: XPCOM, defect)

defect
Not set

Tracking

()

RESOLVED FIXED
mozilla38

People

(Reporter: ehsan, Assigned: ehsan)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

No description provided.
Assignee: nobody → ehsan
Blocks: 1114683
Comment on attachment 8550797 [details] [diff] [review]
Mark findIndexOfClosure as stack class, and make its targetElement member a strong ref

Review of attachment 8550797 [details] [diff] [review]:
-----------------------------------------------------------------

r=me, but I think the strong-refness is just unnecessary work in this case.

::: xpcom/ds/nsArray.cpp
@@ +14,2 @@
>  {
> +  nsCOMPtr<nsISupports> targetElement;

Can't IndexOf() just assume that somebody else is holding references to the element?
Attachment #8550797 - Flags: review?(nfroyd) → review+
I can do something better in fact!  Since this is just used for pointer comparison, I'll convert it to a void*!
https://hg.mozilla.org/mozilla-central/rev/df5fad5e386d
Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla38
You need to log in before you can comment on or make changes to this bug.