summaryrefslogtreecommitdiff
path: root/modules/text_server_adv
diff options
context:
space:
mode:
authorbruvzg <7645683+bruvzg@users.noreply.github.com>2023-01-27 22:53:06 +0200
committerbruvzg <7645683+bruvzg@users.noreply.github.com>2023-01-30 20:47:45 +0200
commit0cc1f4240aecc93f967bab7b27d9b48fd3126a5b (patch)
treeb327dc0e01a4b1f4cf730891ec1b823dd126295b /modules/text_server_adv
parent551f5191e5dbc1d1a43f99b13d5dbbf7f598dc58 (diff)
[RichTextLabel] Fix thread unsafe `set_physics_process_internal` usage. Use `WorkerThreadPool` instead of creating new threads.
Diffstat (limited to 'modules/text_server_adv')
-rw-r--r--modules/text_server_adv/text_server_adv.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/modules/text_server_adv/text_server_adv.cpp b/modules/text_server_adv/text_server_adv.cpp
index e53aef965a..9b474bf2ce 100644
--- a/modules/text_server_adv/text_server_adv.cpp
+++ b/modules/text_server_adv/text_server_adv.cpp
@@ -4068,7 +4068,6 @@ void TextServerAdvanced::_realign(ShapedTextDataAdvanced *p_sd) const {
RID TextServerAdvanced::_shaped_text_substr(const RID &p_shaped, int64_t p_start, int64_t p_length) const {
_THREAD_SAFE_METHOD_
-
const ShapedTextDataAdvanced *sd = shaped_owner.get_or_null(p_shaped);
ERR_FAIL_COND_V(!sd, RID());
@@ -5513,6 +5512,7 @@ void TextServerAdvanced::_shape_run(ShapedTextDataAdvanced *p_sd, int64_t p_star
}
bool TextServerAdvanced::_shaped_text_shape(const RID &p_shaped) {
+ _THREAD_SAFE_METHOD_
ShapedTextDataAdvanced *sd = shaped_owner.get_or_null(p_shaped);
ERR_FAIL_COND_V(!sd, false);
@@ -6569,6 +6569,7 @@ TextServerAdvanced::TextServerAdvanced() {
}
void TextServerAdvanced::_cleanup() {
+ _THREAD_SAFE_METHOD_
for (const KeyValue<SystemFontKey, SystemFontCache> &E : system_fonts) {
const Vector<SystemFontCacheRec> &sysf_cache = E.value.var;
for (const SystemFontCacheRec &F : sysf_cache) {