Skip to content

Conversation

@fengalin
Copy link
Contributor

@fengalin fengalin commented Nov 6, 2024

In some places, 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: gtk-rs/gir#1614

TODO:

  • update gir submodule & regenerate when matching PR is merged.

@fengalin fengalin force-pushed the fix-callback-userdata-mutability branch from 724aebe to 3973c0a Compare November 7, 2024 08:54
@fengalin fengalin changed the title Draft: Fix callback userdata mutability Fix callback userdata mutability Nov 7, 2024
@sdroege sdroege merged commit bd62288 into gtk-rs:main Nov 7, 2024
40 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants