X Tutup
Skip to content

Skip ResourceLoader's progress query if not requested.#113117

Merged
Repiteo merged 1 commit intogodotengine:masterfrom
DarioSamo:resource-load-threaded-skip-progress
Nov 24, 2025
Merged

Skip ResourceLoader's progress query if not requested.#113117
Repiteo merged 1 commit intogodotengine:masterfrom
DarioSamo:resource-load-threaded-skip-progress

Conversation

@DarioSamo
Copy link
Contributor

@DarioSamo DarioSamo commented Nov 24, 2025

This complements #113114 in the sense that ResourceLoader's threaded progress computation should be skipped if not requested by the user. As it is now, progress is computed regardless only to be discarded if the user didn't specify an array to use for the returned value.

This also avoids the critical issue explained in the linked PR, where projects that use the background loader with several threads can end up causing infinite recursion scenarios when computing the loading progress, leading to a crash. However, the crash will remain possible for projects that do query the progress unless the linked PR is merged.

This one should be fairly safe to merge and results in a small optimization as well.

@DarioSamo DarioSamo requested a review from a team as a code owner November 24, 2025 17:22
@DarioSamo DarioSamo added the bug label Nov 24, 2025
@AThousandShips AThousandShips added this to the 4.6 milestone Nov 24, 2025
Copy link
Member

@RandomShaper RandomShaper left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd suggest adding a comment.

@DarioSamo DarioSamo force-pushed the resource-load-threaded-skip-progress branch from 45ef14e to f0e57a7 Compare November 24, 2025 17:41
Copy link
Member

@clayjohn clayjohn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense. This also avoids a lot of unnecessary work that happens within the MutexLock, so its nice to have this optimized in any case

@Repiteo Repiteo merged commit f1de9c4 into godotengine:master Nov 24, 2025
20 checks passed
@Repiteo
Copy link
Contributor

Repiteo commented Nov 24, 2025

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants

X Tutup