Skip to content

Commit 9f05ca9

Browse files
committed
Merge pull request #96218 from RandomShaper/res_loader_user_case
ResourceLoader: Handle another case of user tokens
2 parents 6eeff72 + 0441c67 commit 9f05ca9

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

core/io/resource_loader.cpp

+5
Original file line numberDiff line numberDiff line change
@@ -539,6 +539,11 @@ Ref<ResourceLoader::LoadToken> ResourceLoader::_load_start(const String &p_path,
539539
if (!ignoring_cache && thread_load_tasks.has(local_path)) {
540540
load_token = Ref<LoadToken>(thread_load_tasks[local_path].load_token);
541541
if (load_token.is_valid()) {
542+
if (p_for_user) {
543+
// Load task exists, with no user tokens at the moment.
544+
// Let's "attach" to it.
545+
_load_threaded_request_setup_user_token(load_token.ptr(), p_path);
546+
}
542547
return load_token;
543548
} else {
544549
// The token is dying (reached 0 on another thread).

0 commit comments

Comments
 (0)