From 8a66abb956a81944501d87bb3bdb70be2bda586f Mon Sep 17 00:00:00 2001 From: Aleksey Vasenev Date: Tue, 30 Jul 2024 13:57:03 +0300 Subject: [PATCH] Update core/io/resource_loader.cpp MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Pedro J. Estébanez --- core/io/resource_loader.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/core/io/resource_loader.cpp b/core/io/resource_loader.cpp index c9d456ca641e..64b975ad8edc 100644 --- a/core/io/resource_loader.cpp +++ b/core/io/resource_loader.cpp @@ -725,7 +725,8 @@ Ref ResourceLoader::_load_complete_inner(LoadToken &p_load_token, Erro load_task.cond_var->wait(p_thread_load_lock); DEV_ASSERT(thread_load_tasks.has(p_load_token.local_path) && p_load_token.get_reference_count()); } while (load_task.need_wait); - if (!--load_task.awaiters_count) { + load_task.awaiters_count--; + if (load_task.awaiters_count == 0) { memdelete(load_task.cond_var); load_task.cond_var = nullptr; }