diff options
author | Pedro J. Estébanez <pedrojrulez@gmail.com> | 2023-05-17 00:39:13 +0200 |
---|---|---|
committer | Pedro J. Estébanez <pedrojrulez@gmail.com> | 2023-05-17 01:43:28 +0200 |
commit | 44cc0d2ec24d26dc5499d23df09fcdfa80c943ab (patch) | |
tree | 22645fe2073a12a20020d455f3214d322451cff5 | |
parent | 755c61b57a4422e1564fe24381287ece342a9b6d (diff) | |
download | redot-engine-44cc0d2ec24d26dc5499d23df09fcdfa80c943ab.tar.gz |
Let calls through thread guards in resource loading contexts
-rw-r--r-- | scene/main/node.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/scene/main/node.h b/scene/main/node.h index b7462b4468..b253744824 100644 --- a/scene/main/node.h +++ b/scene/main/node.h @@ -522,8 +522,8 @@ public: _FORCE_INLINE_ bool is_accessible_from_caller_thread() const { if (current_process_thread_group == nullptr) { // Not thread processing. Only accessible if node is outside the scene tree, - // or if accessing from the main thread. - return !data.inside_tree || Thread::is_main_thread(); + // if accessing from the main thread or being loaded. + return !data.inside_tree || Thread::is_main_thread() || ResourceLoader::is_within_load(); } else { // Thread processing return current_process_thread_group == data.process_thread_group_owner; @@ -532,7 +532,7 @@ public: _FORCE_INLINE_ bool is_readable_from_caller_thread() const { if (current_process_thread_group == nullptr) { - return Thread::is_main_thread(); + return Thread::is_main_thread() || ResourceLoader::is_within_load(); } else { return true; } |