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:
parent
14052a0b5a
commit
04cd368cb4
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user