The latest crates update is about tightening up the safety guarantees.
Initialization and threads
gtkwill panic if you try to use them prior to calling
gtk::initor from any thread but the main1 one. We intend to add a set of APIs with static checks but there’s no specific plan at the moment.
glib::timeout_addnow require the closure to be
Sendbecause it might get executed on a different thread.
gtkhas got relaxed versions of these, that don’t require
Sendbut will panic if called from non-main1 thread.
- Panicking in a callback will terminate the process because unwinding across FFI is not allowed.
Builder::get_objectand other similar methods, that are currently unable to check the object type, have been marked unsafe. They will be fixed soon, when the semi-automated branch lands.
glib::Valuebindings are flat out unsafe, have been marked accordingly and need someone to pick them up.
What’s up with the documentation?
We’ve realized that we can’t take the documentation from an LGPL licensed library and just slip it into an MIT-licensed one. Consequently we had to move almost all doc comments into a separate repo. We will keep maintaining online documentation and @GuillaumeGomez is working on a tool, that will allow to put the doc comments back locally.