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 userdata mutability for FnMut callbacks #1614

Merged
merged 1 commit into from
Nov 7, 2024

Conversation

fengalin
Copy link
Contributor

@fengalin fengalin commented Nov 6, 2024

Building userdata for FnMut callbacks consisted in taking an immutable reference to the user provided function, before converting it to a mutable pointer. This was UB and could lead to future optimizations considering a closure's captured context is immutable.

See also:

@sdroege sdroege merged commit e5ad53c into gtk-rs:main Nov 7, 2024
7 checks passed
@sdroege
Copy link
Member

sdroege commented Nov 7, 2024

No changes in gtk-rs-core, not even manual ones? We generally have to check all FnMut closures that are not boxed

@fengalin
Copy link
Contributor Author

fengalin commented Nov 7, 2024

Indeed: changes to gtk-rs-core in gtk-rs/gtk-rs-core#1566

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