rust-x-bindings / rust-xcb

Rust bindings and wrapper for XCB.
MIT License
161 stars 63 forks source link

Make SpecialEventId Copy+Send+Sync #255

Closed kvark closed 4 months ago

kvark commented 6 months ago

Fixes #252

The other way we could approach this is having wait() and poll() to accept a reference to the special event.

rtbo commented 5 months ago

Looking at the C code, xcb_register_special_event allocates memory for the event and xcb_unregister_special_event frees the memory.

So the Copy and Clone traits imply a risk of use after free. The only correct way would be to have reference in wait and poll.

It would be a Semver breaking change though. But current API is broken and unusable anyway.

rtbo commented 4 months ago

closing, fixed by #261