skparagraph: fix leak

Change-Id: Ieb13a5430ac78ba3d310331c72a96f0323e67d6e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/258811
Auto-Submit: Hal Canary <halcanary@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
This commit is contained in:
Hal Canary 2019-12-09 12:01:11 -05:00 committed by Skia Commit-Bot
parent c937bc5025
commit 189f30216b

View File

@ -96,8 +96,8 @@ std::vector<sk_sp<SkTypeface>> FontCollection::findTypefaces(const std::vector<S
sk_sp<SkTypeface> FontCollection::matchTypeface(const SkString& familyName, SkFontStyle fontStyle) {
for (const auto& manager : this->getFontManagerOrder()) {
SkFontStyleSet* set = manager->matchFamily(familyName.c_str());
if (nullptr == set || set->count() == 0) {
sk_sp<SkFontStyleSet> set(manager->matchFamily(familyName.c_str()));
if (!set || set->count() == 0) {
continue;
}