[PDF] Fix mem leak in font subsetting.

Original CL: http://codereview.appspot.com/4809053/

Review URL: http://codereview.appspot.com/4825052

git-svn-id: http://skia.googlecode.com/svn/trunk@1977 2bbb7eff-a529-9590-31e7-b0007b416f81
This commit is contained in:
vandebo@chromium.org 2011-07-27 18:38:11 +00:00
parent 026dceead9
commit 93225ff5d5

View File

@ -469,11 +469,11 @@ static int get_subset_font_stream(const char* fontName,
glyphIDs.count(),
&subsetFont);
if (subsetFontSize > 0 && subsetFont != NULL) {
SkData* data = SkData::NewWithProc(subsetFont,
subsetFontSize,
sk_delete_array,
NULL);
subsetFontStream = new SkPDFStream(data);
SkAutoDataUnref data(SkData::NewWithProc(subsetFont,
subsetFontSize,
sk_delete_array,
NULL));
subsetFontStream = new SkPDFStream(data.get());
fontSize = subsetFontSize;
}
}