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

Issue 18915010: Fix leak in SkAutoSTArray (Closed)

Created:
7 years, 5 months ago by robertphillips
Modified:
7 years, 5 months ago
Reviewers:
bsalomon, reed1
CC:
skia-review_googlegroups.com
Visibility:
Public.

Description

When count == 0 but fCount > N the free is incorrectly skipped.

Patch Set 1 #

Total comments: 1

Patch Set 2 : Addressed code review issues #

Patch Set 3 : Fixed compiler complaint r.e. ">>" vs. "> >" for templates #

Total comments: 2

Patch Set 4 : added assert #

Patch Set 5 : Fix the assert #

Unified diffs Side-by-side diffs Delta from patch set Stats (+73 lines, -2 lines) Patch
M include/core/SkTemplates.h View 1 2 3 4 2 chunks +3 lines, -2 lines 0 comments Download
M tests/UtilsTest.cpp View 1 2 3 4 2 chunks +70 lines, -0 lines 0 comments Download

Messages

Total messages: 6 (0 generated)
robertphillips
7 years, 5 months ago (2013-07-12 14:29:06 UTC) #1
reed1
ding ding ding -- we need a unittest for this guy https://codereview.chromium.org/18915010/diff/1/include/core/SkTemplates.h File include/core/SkTemplates.h (right): ...
7 years, 5 months ago (2013-07-12 14:48:45 UTC) #2
robertphillips
This patch sports a fix for the bug you noted and a unit test that ...
7 years, 5 months ago (2013-07-12 16:52:30 UTC) #3
bsalomon
lgtm
7 years, 5 months ago (2013-07-12 18:14:36 UTC) #4
reed1
lgtm https://codereview.chromium.org/18915010/diff/9001/include/core/SkTemplates.h File include/core/SkTemplates.h (right): https://codereview.chromium.org/18915010/diff/9001/include/core/SkTemplates.h#newcode261 include/core/SkTemplates.h:261: // 'fArray' was allocated last time so free ...
7 years, 5 months ago (2013-07-12 18:23:34 UTC) #5
robertphillips
7 years, 5 months ago (2013-07-12 18:44:43 UTC) #6
Message was sent while issue was closed.
committed as r10053

https://codereview.chromium.org/18915010/diff/9001/include/core/SkTemplates.h
File include/core/SkTemplates.h (right):

https://codereview.chromium.org/18915010/diff/9001/include/core/SkTemplates.h...
include/core/SkTemplates.h:261: // 'fArray' was allocated last time so free it
now
On 2013/07/12 18:23:35, reed1 wrote:
> possibly also
> 
> SkASSERT(fStorage != fArray);

Done.

Powered by Google App Engine
This is Rietveld 408576698