Fix immediate nested loaded assets not loading their dependencies. #21863
+167
−97
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Objective
Solution
Testing
One case that does have a slightly undesirable effect is when you immediately-load an asset, take some data from it (but no dependency handles), and then drop the immediately-loaded asset. This change will now also initiate a dependency load, even though we won't use it.
However, A) it is much more surprising to have a handle that will never be loaded, B) we should end up cancelling the dependency load once we drop the handle, so we shouldn't pay too much of the cost of loading.