Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(70)

Issue 9021020: Fix scoped_refptr assignment operator in the case of having it as a member. (Closed)

Created:
9 years ago by mnaganov (inactive)
Modified:
8 years, 11 months ago
CC:
chromium-reviews, Paweł Hajdan Jr., brettw-cc_chromium.org
Visibility:
Public.

Description

Fix scoped_refptr assignment operator in the case of having it as a member. If a class holds a reference to itself in scoped_refptr, assigning to it a new value leads to calling Release while in destructor. R=levin@chromium.org TEST=RefCountedUnitTest.ScopedRefPtrToSelf Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=116480

Patch Set 1 #

Total comments: 1

Patch Set 2 : Refactored as joth suggests #

Unified diffs Side-by-side diffs Delta from patch set Stats (+31 lines, -2 lines) Patch
M base/memory/ref_counted.h View 1 1 chunk +3 lines, -2 lines 0 comments Download
M base/memory/ref_counted_unittest.cc View 2 chunks +28 lines, -0 lines 0 comments Download

Messages

Total messages: 8 (0 generated)
mnaganov (inactive)
9 years ago (2011-12-21 15:45:06 UTC) #1
mnaganov (inactive)
Marc-Antoine, I see that David is OOO, adding you.
9 years ago (2011-12-21 15:50:09 UTC) #2
M-A Ruel
lgtm
9 years ago (2011-12-21 15:56:36 UTC) #3
joth
drive by :) http://codereview.chromium.org/9021020/diff/1/base/memory/ref_counted.h File base/memory/ref_counted.h (right): http://codereview.chromium.org/9021020/diff/1/base/memory/ref_counted.h#newcode269 base/memory/ref_counted.h:269: } Maybe marginally easier to read ...
9 years ago (2011-12-21 16:51:27 UTC) #4
mnaganov (inactive)
Indeed, thanks! :) I had a feeling there must be something wrong with the assignment ...
9 years ago (2011-12-21 17:02:53 UTC) #5
joth
lgtm
9 years ago (2011-12-22 17:09:06 UTC) #6
mnaganov (inactive)
Darin, I need owner's approval. Can you please take a look?
8 years, 12 months ago (2011-12-28 09:35:32 UTC) #7
darin (slow to review)
8 years, 11 months ago (2012-01-03 20:16:32 UTC) #8
LGTM (I'm surprised we've gotten this far without having to make this change.)

Powered by Google App Engine
This is Rietveld 408576698