Fix: Memory leak in ICUParagraphLayout::NextLine() (#11895)
This function calls icu::BreakIterator::createLineInstance() but does not clean up after it. Instead use a static instance that is cloned (for thread-safety) and deleted as necessary.
This commit is contained in:
@@ -334,6 +334,16 @@ Font *Layouter::GetFont(FontSize size, TextColour colour)
|
||||
return fonts[size][colour].get();
|
||||
}
|
||||
|
||||
/**
|
||||
* Perform initialization of layout engine.
|
||||
*/
|
||||
void Layouter::Initialize()
|
||||
{
|
||||
#if defined(WITH_ICU_I18N) && defined(WITH_HARFBUZZ)
|
||||
ICUParagraphLayoutFactory::InitializeLayouter();
|
||||
#endif /* WITH_ICU_I18N && WITH_HARFBUZZ */
|
||||
}
|
||||
|
||||
/**
|
||||
* Reset cached font information.
|
||||
* @param size Font size to reset.
|
||||
|
Reference in New Issue
Block a user