1
0
mirror of https://github.com/godotengine/godot.git synced 2025-12-06 17:25:19 +00:00

Fix management of safe-for-nodes flag in ResourceLoader and WorkerThreadPool

This commit is contained in:
Pedro J. Estébanez
2023-07-03 12:27:57 +02:00
parent 46424488ed
commit 30925fcfb0
2 changed files with 8 additions and 3 deletions

View File

@@ -309,6 +309,10 @@ void ResourceLoader::_thread_load_function(void *p_userdata) {
}
// --
if (!Thread::is_main_thread()) {
set_current_thread_safe_for_nodes(true);
}
Ref<Resource> res = _load(load_task.remapped_path, load_task.remapped_path != load_task.local_path ? load_task.local_path : String(), load_task.type_hint, load_task.cache_mode, &load_task.error, load_task.use_sub_threads, &load_task.progress);
if (mq_override) {
mq_override->flush();