Safety first (gtk 0.0.6)
The latest crates update is about tightening up the safety guarantees.
Initialization and threads
gdk
andgtk
will panic if you try to use them prior to callinggtk::init
or 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_add
andglib::timeout_add
now require the closure to beSend
because it might get executed on a different thread.gtk
has got relaxed versions of these, that don’t requireSend
but 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_object
and 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::Value
bindings 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.