This is a speculative fix for the crash on IOS
authoregdaniel <egdaniel@google.com>
Mon, 10 Aug 2015 17:06:43 +0000 (10:06 -0700)
committerCommit bot <commit-bot@chromium.org>
Mon, 10 Aug 2015 17:06:43 +0000 (10:06 -0700)
TBR=mtklein

Review URL: https://codereview.chromium.org/1277433005

src/gpu/GrTestUtils.cpp

index da9fc106b3b586d6c5fa8b98b8fcad9ce7de943b..ba70ef6cb9f0f02383d7ee1340e63ed2593ac5f6 100644 (file)
@@ -244,19 +244,16 @@ GrStrokeInfo TestStrokeInfo(SkRandom* random) {
     randomize_stroke_rec(&strokeInfo, random);
     SkPathEffect::DashInfo dashInfo;
     dashInfo.fCount = random->nextRangeU(1, 50) * 2;
-    SkAutoTMalloc<SkScalar> intervals(dashInfo.fCount);
-    dashInfo.fIntervals = intervals.get();
+    dashInfo.fIntervals = SkNEW_ARRAY(SkScalar, dashInfo.fCount);
     SkScalar sum = 0;
     for (int i = 0; i < dashInfo.fCount; i++) {
-    #if defined(SK_BUILD_FOR_IOS)
-        SkDebugf("&dashInfo.fIntervals[%d] = %p\n", i, &dashInfo.fIntervals[i]);
-    #endif
         dashInfo.fIntervals[i] = random->nextRangeScalar(SkDoubleToScalar(0.01),
                                                          SkDoubleToScalar(10.0));
         sum += dashInfo.fIntervals[i];
     }
     dashInfo.fPhase = random->nextRangeScalar(0, sum);
     strokeInfo.setDashInfo(dashInfo);
+    SkDELETE(dashInfo.fIntervals);
     return strokeInfo;
 }