From 98e77113a2e8aedaf9ab1c85aa98f07ae7ffc29e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pedro=20J=2E=20Est=C3=A9banez?= Date: Wed, 28 Aug 2024 13:53:39 +0200 Subject: [PATCH] ResourceLoader: Handle another case of user tokens (cherry picked from commit 0441c67de67b3c84d57e8ade5f3a0fee70959338) --- core/io/resource_loader.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/core/io/resource_loader.cpp b/core/io/resource_loader.cpp index 5204880d9d5..149f382bf10 100644 --- a/core/io/resource_loader.cpp +++ b/core/io/resource_loader.cpp @@ -528,6 +528,11 @@ Ref ResourceLoader::_load_start(const String &p_path, if (!ignoring_cache && thread_load_tasks.has(local_path)) { load_token = Ref(thread_load_tasks[local_path].load_token); if (load_token.is_valid()) { + if (p_for_user) { + // Load task exists, with no user tokens at the moment. + // Let's "attach" to it. + _load_threaded_request_setup_user_token(load_token.ptr(), p_path); + } return load_token; } else { // The token is dying (reached 0 on another thread).