From f0e57a727bc93225a157e0f4bde63302b2012ce4 Mon Sep 17 00:00:00 2001 From: Dario Date: Mon, 24 Nov 2025 14:18:16 -0300 Subject: [PATCH] Skip ResourceLoader's progress query if not requested. --- core/core_bind.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/core/core_bind.cpp b/core/core_bind.cpp index 9930ac8aba5..a215d29c51c 100644 --- a/core/core_bind.cpp +++ b/core/core_bind.cpp @@ -53,10 +53,12 @@ Error ResourceLoader::load_threaded_request(const String &p_path, const String & } ResourceLoader::ThreadLoadStatus ResourceLoader::load_threaded_get_status(const String &p_path, Array r_progress) { - float progress = 0; - ::ResourceLoader::ThreadLoadStatus tls = ::ResourceLoader::load_threaded_get_status(p_path, &progress); + // Progress being the default array indicates the user hasn't requested for it to be computed. // Default array should never be modified, it causes the hash of the method to change. - if (!ClassDB::is_default_array_arg(r_progress)) { + const bool return_progress = !ClassDB::is_default_array_arg(r_progress); + float progress = 0; + ::ResourceLoader::ThreadLoadStatus tls = ::ResourceLoader::load_threaded_get_status(p_path, return_progress ? &progress : nullptr); + if (return_progress) { r_progress.resize(1); r_progress[0] = progress; }