From b285a0fd74280aa18cf89cf7f0a4d7d3ed287fb1 Mon Sep 17 00:00:00 2001 From: Jason Simmons Date: Thu, 8 Oct 2020 13:53:04 -0700 Subject: [PATCH] Clear the Minikin layout cache during engine destruction (flutter/engine#21473) --- .../src/flutter/third_party/txt/src/txt/font_collection.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/engine/src/flutter/third_party/txt/src/txt/font_collection.cc b/engine/src/flutter/third_party/txt/src/txt/font_collection.cc index 31c3ba6d25a..5f895ef41af 100644 --- a/engine/src/flutter/third_party/txt/src/txt/font_collection.cc +++ b/engine/src/flutter/third_party/txt/src/txt/font_collection.cc @@ -27,6 +27,7 @@ #include "flutter/fml/logging.h" #include "flutter/fml/trace_event.h" #include "font_skia.h" +#include "minikin/Layout.h" #include "txt/platform.h" #include "txt/text_style.h" @@ -82,7 +83,9 @@ class TxtFallbackFontProvider FontCollection::FontCollection() : enable_font_fallback_(true) {} -FontCollection::~FontCollection() = default; +FontCollection::~FontCollection() { + minikin::Layout::purgeCaches(); +} size_t FontCollection::GetFontManagersCount() const { return GetFontManagerOrder().size();