$OpenBSD: patch-plugins_gtkui_gtkui_c,v 1.2 2014/02/07 22:20:13 dcoppa Exp $

g_thread_init() is deprecated

Properly call gdk_threads_enter() and gdk_threads_leave() to prevent
abort() on startup due to gtk trying to unlock a uninitialized mutex

--- plugins/gtkui/gtkui.c.orig	Sun Feb  2 19:00:08 2014
+++ plugins/gtkui/gtkui.c	Fri Feb  7 22:22:19 2014
@@ -961,13 +961,8 @@ gtkui_thread (void *ctx) {
     add_pixmap_directory (deadbeef->get_pixmap_dir ());
 
     // let's start some gtk
-    g_thread_init (NULL);
-#ifndef __FreeBSD__
-    // this call makes gtk_main hang on freebsd for unknown reason
-    // however, if we don't have this call, deadbeef will crash randomly on
-    // gentoo linux
     gdk_threads_init ();
-#endif
+    gdk_threads_enter ();
     gtk_init (&argc, (char ***)&argv);
 
     // register widget types
@@ -1128,6 +1123,7 @@ gtkui_thread (void *ctx) {
         gtk_widget_destroy (searchwin);
         searchwin = NULL;
     }
+    gdk_threads_leave ();
     return 0;
 }
 
