Fixing leak of SkPixelRef object in CanvasTest
authorjunov@chromium.org <junov@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>
Thu, 2 Aug 2012 17:43:25 +0000 (17:43 +0000)
committerjunov@chromium.org <junov@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>
Thu, 2 Aug 2012 17:43:25 +0000 (17:43 +0000)
Review URL: https://codereview.appspot.com/6441095

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

tests/CanvasTest.cpp

index 5401026..b58657e 100644 (file)
@@ -885,6 +885,9 @@ static void TestCanvas(skiatest::Reporter* reporter) {
         SkPictureTester::TestPictureFlattenedObjectReuse(reporter,
             testStepArray()[testStep], 0);
     }
+
+    // Explicitly call reset(), so we don't leak the pixels (since kTestBitmap is a global)
+    kTestBitmap.reset();
 }
 
 #include "TestClassDef.h"