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 "Cannot initialize Sdl from more than one thread" for tests / CI #1337

Merged
merged 1 commit into from
Sep 14, 2023

Conversation

austindoupnik
Copy link
Contributor

@austindoupnik austindoupnik commented Sep 14, 2023

Fix #1323

This addresses the issue above, which seems to have been introduced by #1254, which added a flag to indicate which thread was initialized as the main thread. This flag was never cleared which meant that only one thread would ever be the main, if SDL was then quit and attempted to initialize on another thread (while still only having 1 context) it would fail.

If the intention of IS_MAIN_THREAD was to only allow SDL_Init to be invoked once per application, I can find another solution. But I believe there is nothing wrong with this, SDL_Init itself is reference counted, and the tests show an expectation to be able to do so.

@Cobrand
Copy link
Member

Cobrand commented Sep 14, 2023

That seems to be it! Thanks a lot! There still are some minor issues that need to be fixed before we can have a 0.36 , but this was the main hurdle. Thanks again!

@Cobrand Cobrand merged commit 5fecdf7 into Rust-SDL2:master Sep 14, 2023
17 checks passed
@austindoupnik
Copy link
Contributor Author

Sure, let me know if there is anything else I can take a look at. Happy to help

@austindoupnik austindoupnik deleted the fix-1323 branch September 15, 2023 03:44
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.

Fix "Cannot initialize Sdl from more than one thread" for tests / CI
2 participants