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

Issue 1767983002: Fix behavior of sk_sp::reset() and add unittest. (Closed)

Created:
4 years, 9 months ago by reed1
Modified:
4 years, 9 months ago
CC:
reviews_skia.org
Base URL:
https://skia.googlesource.com/skia.git@master
Target Ref:
refs/heads/master
Project:
skia
Visibility:
Public.

Description

Fix behavior of sk_sp::reset(T*) and add unittest. Previously, sk_sp::reset(T* t) did not release its own reference if its internal pointer was the same as 't'. This leaks a reference. Now always release the current reference when non-nullptr. Committed: https://skia.googlesource.com/skia/+/941da9d66171bd8efd2f6c5e25ff90c8c69885c1

Patch Set 1 #

Patch Set 2 : #

Total comments: 2

Patch Set 3 : use unique() correctly #

Unified diffs Side-by-side diffs Delta from patch set Stats (+20 lines, -4 lines) Patch
M include/core/SkRefCnt.h View 1 chunk +2 lines, -4 lines 0 comments Download
M tests/RefCntTest.cpp View 1 2 1 chunk +18 lines, -0 lines 0 comments Download

Messages

Total messages: 25 (12 generated)
reed1
4 years, 9 months ago (2016-03-06 06:36:27 UTC) #3
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1767983002/1 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1767983002/1
4 years, 9 months ago (2016-03-06 06:36:40 UTC) #5
commit-bot: I haz the power
Dry run: Try jobs failed on following builders: Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-Shared-Trybot on client.skia (JOB_FAILED, http://build.chromium.org/p/client.skia/builders/Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-Shared-Trybot/builds/6784)
4 years, 9 months ago (2016-03-06 06:38:31 UTC) #7
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1767983002/20001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1767983002/20001
4 years, 9 months ago (2016-03-06 06:44:30 UTC) #9
commit-bot: I haz the power
Dry run: This issue passed the CQ dry run.
4 years, 9 months ago (2016-03-06 06:54:01 UTC) #11
bungeman-skia
https://codereview.chromium.org/1767983002/diff/20001/tests/RefCntTest.cpp File tests/RefCntTest.cpp (right): https://codereview.chromium.org/1767983002/diff/20001/tests/RefCntTest.cpp#newcode298 tests/RefCntTest.cpp:298: REPORTER_ASSERT(r, 1 == rc->unique()); This reads a little funny ...
4 years, 9 months ago (2016-03-06 14:01:44 UTC) #12
reed1
Doh! Good point. I had used getRefCnt everywhere, but then discovered that it was debug-only. ...
4 years, 9 months ago (2016-03-06 18:52:51 UTC) #13
reed1
ptal https://codereview.chromium.org/1767983002/diff/20001/tests/RefCntTest.cpp File tests/RefCntTest.cpp (right): https://codereview.chromium.org/1767983002/diff/20001/tests/RefCntTest.cpp#newcode298 tests/RefCntTest.cpp:298: REPORTER_ASSERT(r, 1 == rc->unique()); On 2016/03/06 14:01:44, bungeman1 ...
4 years, 9 months ago (2016-03-06 19:03:43 UTC) #14
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1767983002/40001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1767983002/40001
4 years, 9 months ago (2016-03-06 19:03:55 UTC) #16
commit-bot: I haz the power
Dry run: This issue passed the CQ dry run.
4 years, 9 months ago (2016-03-06 19:13:34 UTC) #18
bungeman-skia
lgtm
4 years, 9 months ago (2016-03-06 21:38:39 UTC) #19
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1767983002/40001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1767983002/40001
4 years, 9 months ago (2016-03-06 21:52:45 UTC) #23
commit-bot: I haz the power
4 years, 9 months ago (2016-03-06 21:54:04 UTC) #25
Message was sent while issue was closed.
Committed patchset #3 (id:40001) as
https://skia.googlesource.com/skia/+/941da9d66171bd8efd2f6c5e25ff90c8c69885c1

Powered by Google App Engine
This is Rietveld 408576698