Skip to content

Restructure the logic in AssetServer::load_internal to avoid using weak handles. #19634

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

andriyDev
Copy link
Contributor

Objective

Solution

  • I've restructured the logic here while preserving the behavior (as far as I can tell).
  • We no longer return the handle if it was passed in. The caller should already have access to it, and the returned handle will be a weak handle, not a strong handle (which can cause issues). This prevents us from needing weak handles at all here.
  • I verified the callers do not need the return value. The only callsite that needs the returned handle does not pass in the input_handle argument.

Testing

  • CI

@andriyDev andriyDev added A-Assets Load files from disk to use for things like images, models, and sounds D-Modest A "normal" level of difficulty; suitable for simple features or challenging fixes S-Needs-Review Needs reviewer attention (from anyone!) to move forward C-Code-Quality A section of code that is hard to understand or change labels Jun 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Assets Load files from disk to use for things like images, models, and sounds C-Code-Quality A section of code that is hard to understand or change D-Modest A "normal" level of difficulty; suitable for simple features or challenging fixes S-Needs-Review Needs reviewer attention (from anyone!) to move forward
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants