Work around libsoup type initialization deadlocks

As reported in
https://bugzilla.gnome.org/show_bug.cgi?id=796031#c1
we sometimes hang in libsoup downloading stuff. This uses
an early type initialization to avoid that.

We don't use libsoup for the main download anymore, but
its still used for some things, so better safe than sorry.

Closes: #153
Approved by: alexlarsson
auto
Alexander Larsson 2018-05-18 08:02:51 +02:00 committed by Atomic Bot
parent 74e43641ee
commit dd80a13e1b
1 changed files with 9 additions and 0 deletions

View File

@ -355,6 +355,15 @@ main (int argc,
else
g_unsetenv ("GIO_USE_VFS");
/* Work around libsoup/glib race condition, as per:
https://bugzilla.gnome.org/show_bug.cgi?id=796031 and
https://bugzilla.gnome.org/show_bug.cgi?id=674885#c87 */
g_type_ensure (G_TYPE_SOCKET_FAMILY);
g_type_ensure (G_TYPE_SOCKET_TYPE);
g_type_ensure (G_TYPE_SOCKET_PROTOCOL);
g_type_ensure (G_TYPE_SOCKET_ADDRESS);
orig_argv = g_memdup (argv, sizeof (char *) * argc);
orig_argc = argc;