summaryrefslogtreecommitdiffstats
path: root/modules/text_server_adv/text_server_adv.cpp
diff options
context:
space:
mode:
authorbruvzg <7645683+bruvzg@users.noreply.github.com>2023-02-21 09:43:54 +0200
committerbruvzg <7645683+bruvzg@users.noreply.github.com>2023-02-21 09:43:54 +0200
commit7f24433e15081044aa8bcc3a646ded5129048bf5 (patch)
treed74ce21d71ea16d02bc33547ac167cb7953ee9c1 /modules/text_server_adv/text_server_adv.cpp
parent052d8d804e9ad62f672fe13cecb5de34352b7ea5 (diff)
downloadredot-engine-7f24433e15081044aa8bcc3a646ded5129048bf5.tar.gz
[TextServer] Ensure ICU data is initialised only one and cleaned only at exit.
Diffstat (limited to 'modules/text_server_adv/text_server_adv.cpp')
-rw-r--r--modules/text_server_adv/text_server_adv.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/modules/text_server_adv/text_server_adv.cpp b/modules/text_server_adv/text_server_adv.cpp
index b55188ce0c..697c3b66bb 100644
--- a/modules/text_server_adv/text_server_adv.cpp
+++ b/modules/text_server_adv/text_server_adv.cpp
@@ -334,6 +334,8 @@ _FORCE_INLINE_ bool is_connected_to_prev(char32_t p_chr, char32_t p_pchr) {
/*************************************************************************/
+bool TextServerAdvanced::icu_data_loaded = false;
+
bool TextServerAdvanced::_has_feature(Feature p_feature) const {
switch (p_feature) {
case FEATURE_SIMPLE_LAYOUT:
@@ -6599,5 +6601,6 @@ TextServerAdvanced::~TextServerAdvanced() {
uset_close(allowed);
allowed = nullptr;
}
- u_cleanup();
+
+ std::atexit(u_cleanup);
}