From 98c1328ab8ed1b3efe815b660eaefb4bff760819 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] ResourceLoader: Fixup resource changed feature This is a complement to: https://github.com/godotengine/godot/pull/96593 (cherry picked from commit ab299647b452ea0531c3dc3976a0bdca132d9684) --- 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; }