[Spice-commits] server/red-channel-capabilities.c server/reds.c

Frediano Ziglio fziglio at kemper.freedesktop.org
Thu Mar 30 17:05:49 UTC 2017


 server/red-channel-capabilities.c |    4 ++++
 server/reds.c                     |    3 ---
 2 files changed, 4 insertions(+), 3 deletions(-)

New commits:
commit 3377feef5ad13786a136bddacbb1dc4197854a44
Author: Frediano Ziglio <fziglio at redhat.com>
Date:   Thu Mar 30 13:27:26 2017 +0100

    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 at redhat.com>
    Acked-by: Christophe Fergeau <cfergeau at redhat.com>

diff --git a/server/red-channel-capabilities.c b/server/red-channel-capabilities.c
index c08cc1ae..5a3984ab 100644
--- a/server/red-channel-capabilities.c
+++ b/server/red-channel-capabilities.c
@@ -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,
diff --git a/server/reds.c b/server/reds.c
index c730daac..0b6ca124 100644
--- a/server/reds.c
+++ b/server/reds.c
@@ -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;


More information about the Spice-commits mailing list