From 01813e880a32920e17057ce2b4784f10382ff4f0 Mon Sep 17 00:00:00 2001 From: msarett Date: Mon, 25 Jan 2016 10:51:29 -0800 Subject: [PATCH] Fix leak of SkImageGenerator BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1638463002 Review URL: https://codereview.chromium.org/1638463002 --- dm/DMSrcSink.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dm/DMSrcSink.cpp b/dm/DMSrcSink.cpp index 057b6ae480..5b20e3959f 100644 --- a/dm/DMSrcSink.cpp +++ b/dm/DMSrcSink.cpp @@ -279,7 +279,7 @@ bool get_decode_info(SkImageInfo* decodeInfo, const SkImageInfo& defaultInfo, } Error test_gen(SkCanvas* canvas, SkData* data) { - SkImageGenerator* gen = SkCodecImageGenerator::NewFromEncodedCodec(data); + SkAutoTDelete gen = SkCodecImageGenerator::NewFromEncodedCodec(data); if (!gen) { return "Could not create image generator."; } @@ -293,7 +293,7 @@ Error test_gen(SkCanvas* canvas, SkData* data) { return Error::Nonfatal("Skip testing non-opaque images to 565."); } - SkAutoTDelete image(SkImage::NewFromGenerator(gen, nullptr)); + SkAutoTDelete image(SkImage::NewFromGenerator(gen.detach(), nullptr)); if (!image) { return "Could not create image from codec image generator."; } -- 2.34.1