未验证 提交 e18f2390 编写于 作者: J Jason Simmons 提交者: GitHub

Purge the Skia font cache after deleting an engine's FontCollection (#5598)

See https://github.com/flutter/flutter/issues/18728
上级 b1d3c98f
......@@ -11,6 +11,7 @@
#include "third_party/rapidjson/rapidjson/document.h"
#include "third_party/rapidjson/rapidjson/rapidjson.h"
#include "third_party/skia/include/core/SkFontMgr.h"
#include "third_party/skia/include/core/SkGraphics.h"
#include "third_party/skia/include/core/SkStream.h"
#include "third_party/skia/include/core/SkTypeface.h"
#include "txt/asset_font_manager.h"
......@@ -24,7 +25,10 @@ FontCollection::FontCollection()
collection_->SetDefaultFontManager(SkFontMgr::RefDefault());
}
FontCollection::~FontCollection() = default;
FontCollection::~FontCollection() {
collection_.reset();
SkGraphics::PurgeFontCache();
}
std::shared_ptr<txt::FontCollection> FontCollection::GetFontCollection() const {
return collection_;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册