Fix a Ref count bug in SkFontHost_win_dw.cpp

https://codereview.appspot.com/6495133


Props tinytail.


git-svn-id: http://skia.googlecode.com/svn/trunk@5568 2bbb7eff-a529-9590-31e7-b0007b416f81
This commit is contained in:
bungeman@google.com 2012-09-17 14:25:42 +00:00
parent f92cfcf362
commit 0729b62373

View File

@ -688,9 +688,7 @@ SkTypeface* SkCreateTypefaceFromDWriteFont(IDWriteFontFace* fontFace,
StreamFontFileLoader* fontFileLoader = NULL, StreamFontFileLoader* fontFileLoader = NULL,
IDWriteFontCollectionLoader* fontCollectionLoader = NULL) { IDWriteFontCollectionLoader* fontCollectionLoader = NULL) {
SkTypeface* face = SkTypefaceCache::FindByProcAndRef(FindByDWriteFont, font); SkTypeface* face = SkTypefaceCache::FindByProcAndRef(FindByDWriteFont, font);
if (face) { if (NULL == face) {
face->ref();
} else {
face = DWriteFontTypeface::Create(fontFace, font, fontFamily, face = DWriteFontTypeface::Create(fontFace, font, fontFamily,
fontFileLoader, fontCollectionLoader); fontFileLoader, fontCollectionLoader);
SkTypefaceCache::Add(face, get_style(font), fontCollectionLoader != NULL); SkTypefaceCache::Add(face, get_style(font), fontCollectionLoader != NULL);