mirror of
https://gitlab.uni-freiburg.de/opensourcevdi/spice
synced 2025-12-26 22:48:19 +00:00
Initialize earlier GLib type system if necessary
Before GLib 2.36 you should call g_type_init before attempting any GLib type usage. As constructor function are called before even main we need to call g_type_init much before do_spice_init. Signed-off-by: Frediano Ziglio <fziglio@redhat.com> Acked-by: Christophe Fergeau <cfergeau@redhat.com>
This commit is contained in:
parent
7d86223e21
commit
3377feef5a
@ -61,6 +61,10 @@ static void red_channel_capabilities_free(RedChannelCapabilities *caps)
|
||||
|
||||
SPICE_CONSTRUCTOR_FUNC(red_channel_capabilities_construct)
|
||||
{
|
||||
#if !GLIB_CHECK_VERSION(2,36,0)
|
||||
g_type_init();
|
||||
#endif
|
||||
|
||||
red_channel_capabilities_type =
|
||||
g_boxed_type_register_static("RedChannelCapabilities",
|
||||
(GBoxedCopyFunc) red_channel_capabilities_dup,
|
||||
|
||||
@ -3401,9 +3401,6 @@ static int do_spice_init(RedsState *reds, SpiceCoreInterface *core_interface)
|
||||
{
|
||||
spice_debug("starting %s", VERSION);
|
||||
|
||||
#if !GLIB_CHECK_VERSION(2,36,0)
|
||||
g_type_init();
|
||||
#endif
|
||||
if (core_interface->base.major_version != SPICE_INTERFACE_CORE_MAJOR) {
|
||||
spice_warning("bad core interface version");
|
||||
goto err;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user