Index: tests/ImageDecodingTest.cpp |
diff --git a/tests/ImageDecodingTest.cpp b/tests/ImageDecodingTest.cpp |
index 160260d9c85eadfac4941f572d0b544b24e84dbf..c1ff39fa4e1e80f4bced140853a0c8f5fa00bb7b 100644 |
--- a/tests/ImageDecodingTest.cpp |
+++ b/tests/ImageDecodingTest.cpp |
@@ -502,18 +502,18 @@ static void test_options(skiatest::Reporter* reporter, |
bool useData, |
const SkString& path) { |
SkBitmap bm; |
- SkImageGenerator* gen; |
+ SkAutoTDelete<SkImageGenerator> gen; |
if (useData) { |
if (nullptr == encodedData) { |
return; |
} |
- gen = SkDecodingImageGenerator::Create(encodedData, opts); |
+ gen.reset(SkDecodingImageGenerator::Create(encodedData, opts)); |
} else { |
if (nullptr == encodedStream) { |
return; |
} |
- gen = SkDecodingImageGenerator::Create(encodedStream->duplicate(), opts); |
+ gen.reset(SkDecodingImageGenerator::Create(encodedStream->duplicate(), opts)); |
} |
if (!gen) { |
if (opts.fUseRequestedColorType && (kARGB_4444_SkColorType == opts.fRequestedColorType)) { |
@@ -651,8 +651,8 @@ DEF_TEST(DecodingImageGenerator_ColorTableCheck, r) { |
} |
SkAutoDataUnref encoded(SkData::NewFromFileName(path.c_str())); |
SkBitmap bitmap; |
- SkImageGenerator* gen = SkDecodingImageGenerator::Create(encoded, |
- SkDecodingImageGenerator::Options()); |
+ SkAutoTDelete<SkImageGenerator> gen(SkDecodingImageGenerator::Create(encoded, |
+ SkDecodingImageGenerator::Options())); |
if (!gen) { |
REPORTER_ASSERT(r, false); |
return; |