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

Unified Diff: src/gpu/GrTestUtils.cpp

Issue 1274963003: Plug a leak in GrTestUtils. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrTestUtils.cpp
diff --git a/src/gpu/GrTestUtils.cpp b/src/gpu/GrTestUtils.cpp
index 714b99f65cf3ffd1ea9b9085867d121bf3417a8e..de840cca91e7d8e8ab2f1d8fc1479e0657ae47cd 100644
--- a/src/gpu/GrTestUtils.cpp
+++ b/src/gpu/GrTestUtils.cpp
@@ -244,7 +244,8 @@ GrStrokeInfo TestStrokeInfo(SkRandom* random) {
randomize_stroke_rec(&strokeInfo, random);
SkPathEffect::DashInfo dashInfo;
dashInfo.fCount = random->nextRangeU(1, 50) * 2;
- dashInfo.fIntervals = SkNEW_ARRAY(SkScalar, dashInfo.fCount);
+ SkAutoTDeleteArray<SkScalar> intervals(SkNEW_ARRAY(SkScalar, dashInfo.fCount));
+ dashInfo.fIntervals = intervals.get();
SkScalar sum = 0;
for (int i = 0; i < dashInfo.fCount; i++) {
dashInfo.fIntervals[i] = random->nextRangeScalar(SkDoubleToScalar(0.01),
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698