Warning: threads_leave is deprecated since 3.6.
Leaves a critical region begun with threads_enter.
All GDK and GTK+ calls should be made from the main thread