From: scroggo@google.com Date: Wed, 1 Aug 2012 20:53:33 +0000 (+0000) Subject: Fix memory leak in gammatext GM. X-Git-Tag: accepted/tizen/5.0/unified/20181102.025319~15335 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=19c2894bc74567d28716026ad400408d79ceae2f;p=platform%2Fupstream%2FlibSkiaSharp.git Fix memory leak in gammatext GM. Review URL: https://codereview.appspot.com/6458055 git-svn-id: http://skia.googlecode.com/svn/trunk@4902 2bbb7eff-a529-9590-31e7-b0007b416f81 --- diff --git a/gm/gammatext.cpp b/gm/gammatext.cpp index bbd2409..3e3163c 100644 --- a/gm/gammatext.cpp +++ b/gm/gammatext.cpp @@ -47,7 +47,7 @@ static CGContextRef makeCG(const SkBitmap& bm) { CGContextRef cg = CGBitmapContextCreate(bm.getPixels(), bm.width(), bm.height(), 8, bm.rowBytes(), space, BITMAP_INFO_RGB); CFRelease(space); - + CGContextSetAllowsFontSubpixelQuantization(cg, false); CGContextSetShouldSubpixelQuantizeFonts(cg, false); @@ -185,6 +185,9 @@ protected: } x += SkIntToScalar(1024) / SK_ARRAY_COUNT(fg); } +#ifdef SK_BUILD_FOR_MAC + CGContextRelease(cg); +#endif } private: