Fix leaks in blurrect benchs and gm.
Review URL: https://codereview.appspot.com/7071060
git-svn-id: http://skia.googlecode.com/svn/trunk@7142 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/bench/BlurRectBench.cpp b/bench/BlurRectBench.cpp
index e9234a8..b0b06e6 100644
--- a/bench/BlurRectBench.cpp
+++ b/bench/BlurRectBench.cpp
@@ -91,6 +91,7 @@
SkMask mask;
SkBlurMask::BlurRect(&mask, r, radius(), SkBlurMask::kNormal_Style,
SkBlurMask::kHigh_Quality);
+ SkMask::FreeImage(mask.fImage);
}
};
@@ -104,12 +105,18 @@
} else {
name.printf("blurrect_separable_%d", SkScalarRound(rad));
}
-
setName(name);
+ fSrcMask.fImage = NULL;
+ }
+
+ ~BlurRectSeparableBench() {
+ SkMask::FreeImage(fSrcMask.fImage);
}
protected:
virtual void preBenchSetup(const SkRect& r) SK_OVERRIDE {
+ SkMask::FreeImage(fSrcMask.fImage);
+
r.roundOut(&fSrcMask.fBounds);
fSrcMask.fFormat = SkMask::kA8_Format;
fSrcMask.fRowBytes = fSrcMask.fBounds.width();
@@ -123,6 +130,7 @@
SkBlurMask::BlurSeparable(&mask, fSrcMask, radius(),
SkBlurMask::kNormal_Style,
SkBlurMask::kHigh_Quality);
+ SkMask::FreeImage(mask.fImage);
}
};