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.
(cherry picked from commit 6d276698b6
)
This commit is contained in:

committed by
Jonathan G Rennison

parent
5b052ff91a
commit
009fea0e14
@@ -337,6 +337,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