Fix memory leak in AAClipTest

We were not freeing the memory allocated by copyToMask in
one place.

Change-Id: I4404395e8bc2beb43eca5226e947c42b22805ef7
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/526076
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
This commit is contained in:
Kevin Lubick 2022-03-30 14:34:27 -04:00
parent 0361abf39d
commit 145e18f5cc

View File

@ -119,6 +119,8 @@ static bool operator==(const SkRasterClip& a, const SkRasterClip& b) {
SkMask mask0, mask1;
copyToMask(a, &mask0);
copyToMask(b, &mask1);
SkAutoMaskFreeImage free0(mask0.fImage);
SkAutoMaskFreeImage free1(mask1.fImage);
return mask0 == mask1;
}
@ -142,11 +144,9 @@ static bool operator==(const SkRegion& rgn, const SkAAClip& aaclip) {
copyToMask(rgn, &mask0);
aaclip.copyToMask(&mask1);
bool eq = (mask0 == mask1);
SkMask::FreeImage(mask0.fImage);
SkMask::FreeImage(mask1.fImage);
return eq;
SkAutoMaskFreeImage free0(mask0.fImage);
SkAutoMaskFreeImage free1(mask1.fImage);
return mask0 == mask1;
}
static bool equalsAAClip(const SkRegion& rgn) {