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:
@@ -37,6 +37,7 @@
|
||||
#include "network/network_content_gui.h"
|
||||
#include "newgrf_engine.h"
|
||||
#include "core/backup_type.hpp"
|
||||
#include "gfx_layout.h"
|
||||
#include <stack>
|
||||
#include <charconv>
|
||||
|
||||
@@ -1976,6 +1977,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