/*****************************************************************************
* Preamble
*****************************************************************************/
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
#include <vlc/vlc.h>
+#include <vlc_plugin.h>
#include <gtk/gtk.h>
{
vlc_mutex_t *lock;
- /* FIXME: put this in the module (de)initialization ASAP */
- lock = var_GetGlobalCreate( "gtk" );
- vlc_mutex_lock( lock );
+ lock = var_AcquireMutex( "gtk" );
if( i_refcount > 0 )
{
/* Launch the gtk_main() thread. It will not return until it has
* called gdk_threads_enter(), which ensures us thread safety. */
if( vlc_thread_create( p_gtk_main, "gtk_main", GtkMain,
- VLC_THREAD_PRIORITY_LOW, VLC_TRUE ) )
+ VLC_THREAD_PRIORITY_LOW, true ) )
{
- vlc_object_destroy( p_gtk_main );
+ vlc_object_release( p_gtk_main );
i_refcount--;
vlc_mutex_unlock( lock );
return VLC_ETHREAD;
{
vlc_mutex_t *lock;
- lock = var_GetGlobalMutex( "gtk" );
- vlc_mutex_lock( lock );
+ lock = var_AcquireMutex( "gtk" );
i_refcount--;
gtk_main_quit();
vlc_thread_join( p_gtk_main );
- vlc_object_destroy( p_gtk_main );
+ vlc_object_release( p_gtk_main );
p_gtk_main = NULL;
vlc_mutex_unlock( lock );
gdk_threads_leave();
}
-