Safety first (gtk 0.0.6)
The latest crates update is about tightening up the safety guarantees.
Initialization and threads
gdkandgtkwill panic if you try to use them prior to callinggtk::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::idle_addandglib::timeout_addnow require the closure to beSendbecause it might get executed on a different thread.gtkhas got relaxed versions of these, that don’t requireSendbut will panic if called from non-main1 thread.- Panicking in a callback will terminate the process because unwinding across FFI is not allowed.
Unfinished APIs
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.- Current
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.