Skip to content
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

Fix Multithreaded Scene Loading #82

Merged
merged 4 commits into from
Mar 25, 2024
Merged

Fix Multithreaded Scene Loading #82

merged 4 commits into from
Mar 25, 2024

Conversation

plink-plonk-will
Copy link
Contributor

Hi!

I hope you don't mind, but I noticed that when loading scenes from threads that contain ControllerIcon textures I would get crashes. (https://docs.godotengine.org/en/stable/tutorials/io/background_loading.html)

This PR fixes the crash by ensuring the texture load happens on the main thread.

I also updated the import file for steamdeck dpad_right to match the other import files.

Copy link
Owner

@rsubtil rsubtil left a comment

Choose a reason for hiding this comment

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

Thank you for your contribution!

The changes makes sense, but I'd like to test if it's possible to maintain the current behavior and instead detect a multi-threaded scenario to then call it as deferred. The current proposed solution leaves the texture path uninitialized for the first frame, which in some scenarios causes errors, like when embedding on a RichTextLabel:
image

addons/controller_icons/objects/ControllerIconTexture.gd Outdated Show resolved Hide resolved
@rsubtil rsubtil merged commit 9564f73 into rsubtil:master Mar 25, 2024
@rsubtil
Copy link
Owner

rsubtil commented Mar 25, 2024

Thank you so much for your contribution! ❤️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants