Last Comment Bug 702799 - Don't change a RefPtr when using the implicit conversion to TemporaryRef
: Don't change a RefPtr when using the implicit conversion to TemporaryRef
Product: Core
Classification: Components
Component: MFBT (show other bugs)
: Trunk
: All All
: -- normal (vote)
: mozilla11
Assigned To: Joe Drew (not getting mail)
Depends on:
  Show dependency treegraph
Reported: 2011-11-15 15:02 PST by Joe Drew (not getting mail)
Modified: 2012-02-01 13:59 PST (History)
5 users (show)
See Also:
Crash Signature:
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---

don't call forget (744 bytes, patch)
2011-11-15 15:02 PST, Joe Drew (not getting mail)
cjones.bugs: review+
Details | Diff | Splinter Review

Description Joe Drew (not getting mail) 2011-11-15 15:02:49 PST
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.
Comment 1 Chris Jones [:cjones] inactive; ni?/f?/r? if you need me 2011-11-15 18:43:09 PST
Comment on attachment 574704 [details] [diff] [review]
don't call forget

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

  return mFoo;

nulling out mFoo, which I agree is a convincing example that this operator is counter-intuitive.  Sold.
Comment 2 Mozilla RelEng Bot 2011-11-15 20:50:34 PST
Try run for 066438f1bf60 is complete.
Detailed breakdown of the results available here:
Results (out of 93 total builds):
    success: 83
    warnings: 9
    failure: 1
Builds available at
Comment 3 Joe Drew (not getting mail) 2011-11-21 13:44:03 PST
Pushed to inbound:
Comment 4 Ed Morley [:emorley] 2011-11-21 19:06:53 PST

Note You need to log in before you can comment on or make changes to this bug.