Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(433)

Unified Diff: dm/DMSrcSink.cpp

Issue 1638463002: Fix leak of SkImageGenerator (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: dm/DMSrcSink.cpp
diff --git a/dm/DMSrcSink.cpp b/dm/DMSrcSink.cpp
index 057b6ae480c857460fa81683211eea349e6eaae3..5b20e3959fbb0dcb95148c088868cc2cd09c8cb6 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<SkImageGenerator> 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<SkImage> image(SkImage::NewFromGenerator(gen, nullptr));
+ SkAutoTDelete<SkImage> image(SkImage::NewFromGenerator(gen.detach(), nullptr));
djsollen 2016/01/25 18:34:07 why do you need to detach here? Does SkImage prom
if (!image) {
return "Could not create image from codec image generator.";
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698