]> git.sesse.net Git - vlc/blobdiff - modules/misc/gtk_main.c
simplify service discoveries
[vlc] / modules / misc / gtk_main.c
index c5b0d98069411954353fa0500ad4620ed59ffc70..68a9c2848d36190d1d3f05a84cb5c4f27e69f369 100644 (file)
@@ -48,7 +48,7 @@
 static int  Open    ( vlc_object_t * );
 static void Close   ( vlc_object_t * );
 
-static void GtkMain ( vlc_object_t * );
+static void* GtkMain ( vlc_object_t * );
 
 /*****************************************************************************
  * Local variables (mutex-protected).
@@ -158,7 +158,7 @@ static gint foo( gpointer bar ) { return TRUE; }
  * this part of the interface is in a separate thread so that we can call
  * gtk_main() from within it without annoying the rest of the program.
  *****************************************************************************/
-static void GtkMain( vlc_object_t *p_this )
+static void* GtkMain( vlc_object_t *p_this )
 {
     /* gtk_init needs to know the command line. We don't care, so we
      * give it an empty one */
@@ -167,6 +167,7 @@ static void GtkMain( vlc_object_t *p_this )
     static char **pp_args  = p_args;
 #endif
     static int    i_args   = 1;
+    int canc = vlc_savecancel ();
 
     /* FIXME: deprecated ? */
 #if defined(MODULE_NAME_IS_gtk2_main) || defined(MODULE_NAME_IS_gnome2_main)
@@ -197,4 +198,6 @@ static void GtkMain( vlc_object_t *p_this )
     gtk_main();
 
     gdk_threads_leave();
+    vlc_restorecancel (canc);
+    return NULL;
 }