gdbus-connection: Work around race in connection tests
[platform/upstream/glib.git] / gio / tests / socket-server.c
index 2a442bb..decf3ec 100644 (file)
@@ -63,8 +63,6 @@ main (int argc,
   GInputStream *istream;
   GOutputStream *ostream;
 
-  g_type_init ();
-
   context = g_option_context_new (" - Test GSocket server stuff");
   g_option_context_add_main_entries (context, cmd_entries, NULL);
   if (!g_option_context_parse (context, &argc, &argv, &error))
@@ -81,8 +79,10 @@ main (int argc,
 
   if (cancel_timeout)
     {
+      GThread *thread;
       cancellable = g_cancellable_new ();
-      g_thread_new ("cancel", cancel_thread, cancellable, FALSE, NULL);
+      thread = g_thread_new ("cancel", cancel_thread, cancellable);
+      g_thread_unref (thread);
     }
   else
     {