Oops, CreateTypeface takes over ownership of the stream, instead of just ref()

This should be changed, for until it is, fix CreateTypefaceFromFile to not call
unref() if the typeface got created.



git-svn-id: http://skia.googlecode.com/svn/trunk@94 2bbb7eff-a529-9590-31e7-b0007b416f81
This commit is contained in:
reed@android.com 2009-02-20 21:11:40 +00:00
parent 1bfd0ca780
commit ff7f389c8a

View File

@ -577,10 +577,10 @@ SkTypeface* SkFontHost::CreateTypefaceFromFile(const char path[]) {
SkFILEStream* stream = SkNEW_ARGS(SkFILEStream, (path));
if (stream->isValid()) {
face = CreateTypeface(stream);
return CreateTypeface(stream);
}
stream->unref();
return face;
return NULL;
}
///////////////////////////////////////////////////////////////////////////////