ResourceLoader: Handle another case of user tokens

This commit is contained in:
Pedro J. Estébanez 2024-08-28 13:53:39 +02:00
parent 108c603f91
commit 0441c67de6

View File

@ -539,6 +539,11 @@ Ref<ResourceLoader::LoadToken> ResourceLoader::_load_start(const String &p_path,
if (!ignoring_cache && thread_load_tasks.has(local_path)) {
load_token = Ref<LoadToken>(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).