Don't change a RefPtr when using the implicit conversion to TemporaryRef

RESOLVED FIXED in mozilla11

Status

()

Core
MFBT
RESOLVED FIXED
6 years ago
5 years ago

People

(Reporter: Joe Drew (not getting mail), Assigned: Joe Drew (not getting mail))

Tracking

Trunk
mozilla11
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Assignee)

Description

6 years ago
Created attachment 574704 [details] [diff] [review]
don't call forget

Right now |RefPtr::operator TemporaryRef<U>()| calls forget() on |this|, which sets ptr to NULL. This is highly unexpected. This patch fixes it.
Attachment #574704 - Flags: review?(jones.chris.g)
Comment on attachment 574704 [details] [diff] [review]
don't call forget

For reference: bug 661973 comment 37.  Joe brought up the example of

TemporaryRef<Foo>
Bar()
{
  return mFoo;
}

nulling out mFoo, which I agree is a convincing example that this operator is counter-intuitive.  Sold.
Attachment #574704 - Flags: review?(jones.chris.g) → review+

Comment 2

6 years ago
Try run for 066438f1bf60 is complete.
Detailed breakdown of the results available here:
    https://tbpl.mozilla.org/?tree=Try&rev=066438f1bf60
Results (out of 93 total builds):
    success: 83
    warnings: 9
    failure: 1
Builds available at http://ftp.mozilla.org/pub/mozilla.org/firefox/try-builds/jdrew@mozilla.com-066438f1bf60
(Assignee)

Comment 3

6 years ago
Pushed to inbound: https://hg.mozilla.org/integration/mozilla-inbound/rev/3b3c9e09abe3
Assignee: nobody → joe
Target Milestone: --- → mozilla11

Comment 4

6 years ago
https://hg.mozilla.org/mozilla-central/rev/3b3c9e09abe3
Status: NEW → RESOLVED
Last Resolved: 6 years ago
Resolution: --- → FIXED
Component: XPCOM → MFBT
OS: Mac OS X → All
QA Contact: xpcom → mfbt
Hardware: x86 → All
You need to log in before you can comment on or make changes to this bug.