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
@@ -40,6 +40,7 @@
|
||||
#include "newgrf_engine.h"
|
||||
#include "tbtr_template_vehicle_func.h"
|
||||
#include "core/backup_type.hpp"
|
||||
#include "gfx_layout.h"
|
||||
#include "core/y_combinator.hpp"
|
||||
#include <stack>
|
||||
#include <charconv>
|
||||
@@ -2294,6 +2295,8 @@ bool ReadLanguagePack(const LanguageMetadata *lang)
|
||||
}
|
||||
#endif /* WITH_ICU_I18N */
|
||||
|
||||
Layouter::Initialize();
|
||||
|
||||
/* Some lists need to be sorted again after a language change. */
|
||||
ReconsiderGameScriptLanguage();
|
||||
InitializeSortedCargoSpecs();
|
||||
|
Reference in New Issue
Block a user