Browse Source

Merge pull request #94070 from RandomShaper/fix_wtp_rl_annoyance

ResourceLoader: Fix error message due to already-awaited tasks being re-awaited
Rémi Verschelde 1 year ago
parent
commit
f85b1e4e3a
1 changed files with 1 additions and 1 deletions
  1. 1 1
      core/io/resource_loader.cpp

+ 1 - 1
core/io/resource_loader.cpp

@@ -688,6 +688,7 @@ Ref<Resource> ResourceLoader::_load_complete_inner(LoadToken &p_load_token, Erro
 			Error wtp_task_err = FAILED;
 			Error wtp_task_err = FAILED;
 			if (loader_is_wtp) {
 			if (loader_is_wtp) {
 				// Loading thread is in the worker pool.
 				// Loading thread is in the worker pool.
+				load_task.awaited = true;
 				thread_load_mutex.unlock();
 				thread_load_mutex.unlock();
 				wtp_task_err = WorkerThreadPool::get_singleton()->wait_for_task_completion(load_task.task_id);
 				wtp_task_err = WorkerThreadPool::get_singleton()->wait_for_task_completion(load_task.task_id);
 			}
 			}
@@ -712,7 +713,6 @@ Ref<Resource> ResourceLoader::_load_complete_inner(LoadToken &p_load_token, Erro
 					} else {
 					} else {
 						DEV_ASSERT(wtp_task_err == OK);
 						DEV_ASSERT(wtp_task_err == OK);
 						thread_load_mutex.lock();
 						thread_load_mutex.lock();
-						load_task.awaited = true;
 					}
 					}
 				} else {
 				} else {
 					// Loading thread is main or user thread.
 					// Loading thread is main or user thread.