From 971c10a8d7b87972be026eaeab9d91938604a210 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pedro=20J=2E=20Est=C3=A9banez?= Date: Fri, 6 Sep 2024 17:43:05 +0200 Subject: [PATCH] =?UTF-8?q?=C3=A7ResourceLoader:=20Fixup=20resource=20chan?= =?UTF-8?q?ged=20feature?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This is a complement to: https://github.com/godotengine/godot/pull/96593 (cherry picked from commit ef365d063917a7694443e800ba72f2c518421334) --- core/io/resource_loader.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/core/io/resource_loader.cpp b/core/io/resource_loader.cpp index 6a35837ac522..aeb492eec0fa 100644 --- a/core/io/resource_loader.cpp +++ b/core/io/resource_loader.cpp @@ -830,6 +830,8 @@ Ref ResourceLoader::_load_complete_inner(LoadToken &p_load_token, Erro load_task_ptr = &load_task; } + thread_load_mutex.unlock(); + Ref resource = load_task_ptr->resource; if (r_error) { *r_error = load_task_ptr->error; @@ -867,6 +869,8 @@ Ref ResourceLoader::_load_complete_inner(LoadToken &p_load_token, Erro } } + thread_load_mutex.lock(); + return resource; }