Fix leak of mask in draw.
authorbungeman@google.com <bungeman@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>
Mon, 26 Sep 2011 19:09:08 +0000 (19:09 +0000)
committerbungeman@google.com <bungeman@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>
Mon, 26 Sep 2011 19:09:08 +0000 (19:09 +0000)
http://codereview.appspot.com/5132046/

git-svn-id: http://skia.googlecode.com/svn/trunk@2333 2bbb7eff-a529-9590-31e7-b0007b416f81

src/core/SkDraw.cpp

index e5027d4a5529e134e9707c4db735c62e14493cd8..826ef7b6a97a1c2537efd46ac9cb96c69e09d915 100644 (file)
@@ -784,16 +784,14 @@ void SkDraw::drawDevMask(const SkMask& srcM, const SkPaint& paint) const {
         return;
     }
 
-    SkMask          dstM;
-    const SkMask*   mask = &srcM;
-
-    dstM.fImage = NULL;
-    SkAutoMaskImage ami(&dstM, false);
+    const SkMask* mask = &srcM;
 
+    SkMask dstM;
     if (paint.getMaskFilter() &&
             paint.getMaskFilter()->filterMask(&dstM, srcM, *fMatrix, NULL)) {
         mask = &dstM;
     }
+    SkAutoMaskImage ami(&dstM, false);
 
     if (fBounder && !fBounder->doIRect(mask->fBounds)) {
         return;