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

Ensure texture loading happens on the main thread #103

Merged
merged 1 commit into from
Aug 27, 2024

Conversation

rsubtil
Copy link
Owner

@rsubtil rsubtil commented Aug 26, 2024

Fixes #101.

Godot 4.3 had a core change with multi-threaded resource loading. This now occurs in a thread, and call_deferred is no longer a viable "hack" to ensure it runs on the main thread. To ensure this, such scenarios were changed to depend on the ControllerIcons singleton for ensuring a function call is executed on the main thread.

@plink-plonk-will this is essentially the same approach of #96, so I've added you as a co-author. I only decided to simplify it by keeping the logic on the texture icon code, keeping the singleton side as simple as possible.

@plink-plonk-will
Copy link
Contributor

Excellent - I just master with our project, and it crashes on start (due to the threading issue). With this branch, it works fine: and the code looks good. Thank you @rsubtil !

@mynameiswhm
Copy link

Works fine on my case as well, thanks!

@rsubtil rsubtil merged commit 1358688 into master Aug 27, 2024
@rsubtil rsubtil deleted the make_texture_load_thread_safe branch August 27, 2024 10:08
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.

Godot 4.3: crash when using ControllerIconTexture as external resource file on macOS
3 participants