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

Unsound code related to subsystem reference counting #107

Closed
antonilol opened this issue Feb 12, 2025 · 4 comments · Fixed by #120
Closed

Unsound code related to subsystem reference counting #107

antonilol opened this issue Feb 12, 2025 · 4 comments · Fixed by #120

Comments

@antonilol
Copy link
Contributor

antonilol commented Feb 12, 2025

I also suspect that EventSubsystem::sdl is unsound, because it is Sync this can be called from any thread, not only the main thread, effectively copying instances of the Sdl struct to other threads.

Originally posted by @antonilol in #102 (comment)

Instances of the Sdl struct should not be sent between threads (it is !Send)

@antonilol
Copy link
Contributor Author

A possible solution is removing https://github.com/vhspace/sdl3-rs/blob/master/src/sdl3/sdl.rs#L260-L272. Does this method add any value? Sdl contexts can be cloned already if needed.

@revmischa
Copy link
Collaborator

A possible solution is removing https://github.com/vhspace/sdl3-rs/blob/master/src/sdl3/sdl.rs#L260-L272. Does this method add any value? Sdl contexts can be cloned already if needed.

I don't know if it's used at all, maybe!

@antonilol
Copy link
Contributor Author

It does not seem to be used in the crate itself, but it is public API, so is it okay to remove it in the next breaking change?

@revmischa
Copy link
Collaborator

Yeah I'm not calling anything super stable yet

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 a pull request may close this issue.

2 participants