aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests
diff options
context:
space:
mode:
authorGravatar mtklein <mtklein@chromium.org>2015-01-24 11:27:27 -0800
committerGravatar Commit bot <commit-bot@chromium.org>2015-01-24 11:27:27 -0800
commit31ff29829e3ceb8f5af0a655285d83abb6662c85 (patch)
tree9eb0fd8495da8c40eff2ca8d8410ae4b9861e3e5 /tests
parent070eaeec03a86c4760af4ca99a6406cad26b5a99 (diff)
Don't leak image in Surface test.
==7023== 5,056 (896 direct, 4,160 indirect) bytes in 8 blocks are definitely lost in loss record 947 of 2,656 ==7023== at 0x4C2B1C7: operator new(unsigned long) (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so) ==7023== by 0x82CB99: SkNewImageFromBitmapTexture(SkBitmap const&, int, SkSurface::Budgeted) (SkImage_Gpu.cpp:64) ==7023== by 0x81A1CF: SkSurface_Gpu::onNewImageSnapshot(SkSurface::Budgeted) (SkSurface_Gpu.cpp:50) ==7023== by 0x694F9D: SkSurface::newImageSnapshot(SkSurface::Budgeted) (SkSurface_Base.h:92) ==7023== by 0x55EA7C: test_Surface(skiatest::Reporter*, GrContextFactory*) (SurfaceTest.cpp:485) ==7023== by 0x407CB2: run_test(skiatest::Test*) (DM.cpp:399) ==7023== by 0x408382: run_enclave_and_gpu_tests(SkTArray<Task, false>*) (DM.cpp:411) ==7023== by 0x68B71E: SkTaskGroup::wait() (SkTaskGroup.cpp:67) ==7023== by 0x40934E: dm_main() (DM.cpp:455) ==7023== by 0x409483: main (DM.cpp:477) http://build.chromium.org/p/client.skia/builders/Test-Ubuntu12-ShuttleA-GTX550Ti-x86_64-Release-Valgrind/builds/276/steps/dm/logs/stdio TBR=bsalomon@google.com BUG=skia: Review URL: https://codereview.chromium.org/872183002
Diffstat (limited to 'tests')
-rw-r--r--tests/SurfaceTest.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/tests/SurfaceTest.cpp b/tests/SurfaceTest.cpp
index 94490144ed..8cd50ddd33 100644
--- a/tests/SurfaceTest.cpp
+++ b/tests/SurfaceTest.cpp
@@ -482,7 +482,7 @@ static void test_surface_budget(skiatest::Reporter* reporter, GrContext* context
SkASSERT(surface);
REPORTER_ASSERT(reporter, sbudgeted == is_budgeted(surface));
- SkImage* image = surface->newImageSnapshot(ibudgeted);
+ SkAutoTUnref<SkImage> image(surface->newImageSnapshot(ibudgeted));
// Initially the image shares a texture with the surface, and the surface decides
// whether it is budgeted or not.