From: robertphillips Date: Fri, 21 Nov 2014 14:53:00 +0000 (-0800) Subject: Fix memory leak in nanobench X-Git-Tag: submit/tizen/20180928.044319~4767 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=186a08ed72749976b533efe7abec062e20c48bda;p=platform%2Fupstream%2FlibSkiaSharp.git Fix memory leak in nanobench This is cleanup for (Add MultiPictureDraw to nanobench - https://codereview.chromium.org/731973005/) Review URL: https://codereview.chromium.org/730343003 --- diff --git a/bench/SKPBench.cpp b/bench/SKPBench.cpp index fd8df429c2..3e692171db 100644 --- a/bench/SKPBench.cpp +++ b/bench/SKPBench.cpp @@ -73,7 +73,8 @@ void SKPBench::onPerCanvasPostDraw(SkCanvas* canvas) { // Draw the last set of tiles into the master canvas in case we're // saving the images for (int i = 0; i < fTileRects.count(); ++i) { - canvas->drawImage(fSurfaces[i]->newImageSnapshot(), + SkAutoTUnref image(fSurfaces[i]->newImageSnapshot()); + canvas->drawImage(image, SkIntToScalar(fTileRects[i].fLeft), SkIntToScalar(fTileRects[i].fTop)); SkSafeSetNull(fSurfaces[i]); }