Fix memory leak in etc1bitmap GM.

We never drop our first ref on fileData. (All our ref counts start at one).
SkAutoTUnref<T> is almost always the right thing to use for refcounted types.

BUG=skia:2635
R=krajcevski@google.com, mtklein@google.com

Author: mtklein@chromium.org

Review URL: https://codereview.chromium.org/310793003
This commit is contained in:
mtklein 2014-06-03 09:04:33 -07:00 committed by Commit bot
parent 14052a0b5a
commit 04cd368cb4

View File

@ -38,7 +38,7 @@ protected:
SkString filename = SkOSPath::SkPathJoin(
INHERITED::gResourcePath.c_str(), "mandrill_512.pkm");
SkData *fileData = SkData::NewFromFileName(filename.c_str());
SkAutoTUnref<SkData> fileData(SkData::NewFromFileName(filename.c_str()));
if (NULL == fileData) {
SkDebugf("Could not open the file. Did you forget to set the resourcePath?\n");
return;