Don't leak ref returned by SkFontMgr::matchFamilyStyle.
The current code does an extra ref on the SkTypeface returned from SkFontMgr::matchFamilyStyle. This old API needs to be updated to return sk_sp<SkTypeface> instead of a ref'ed bare SkTypeface*. Bug: skia:10325 Change-Id: I191b494fb86b99fc53b6eb850d65ba73e60dc489 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/294038 Auto-Submit: Ben Wagner <bungeman@google.com> Commit-Queue: Julia Lavrova <jlavrova@google.com> Reviewed-by: Julia Lavrova <jlavrova@google.com>
This commit is contained in:
parent
c3320be506
commit
bfe44b6974
@ -131,8 +131,8 @@ sk_sp<SkTypeface> FontCollection::defaultFallback() {
|
||||
if (fDefaultFontManager == nullptr) {
|
||||
return nullptr;
|
||||
}
|
||||
auto result = fDefaultFontManager->matchFamilyStyle(fDefaultFamilyName.c_str(), SkFontStyle());
|
||||
return sk_ref_sp<SkTypeface>(result);
|
||||
return sk_sp<SkTypeface>(fDefaultFontManager->matchFamilyStyle(fDefaultFamilyName.c_str(),
|
||||
SkFontStyle()));
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user