[glib] Call glib_init from the gobject constructor



commit 8d83aace106b6832629a3e05f49d074a4288c8df
Author: Matthias Clasen <mclasen redhat com>
Date:   Tue Oct 6 20:09:08 2015 -0400

    Call glib_init from the gobject constructor
    
    We are using quarks in the gobject constructor, among other things,
    so we need to ensure that glib is being initialized first.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=756139

 gobject/gtype.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)
---
diff --git a/gobject/gtype.c b/gobject/gtype.c
index 990002b..be1922c 100644
--- a/gobject/gtype.c
+++ b/gobject/gtype.c
@@ -31,6 +31,7 @@
 #include "gatomicarray.h"
 #include "gobject_trace.h"
 
+#include "glib-private.h"
 #include "gconstructor.h"
 
 #ifdef G_ENABLE_DEBUG
@@ -4376,6 +4377,11 @@ gobject_init_ctor (void)
   TypeNode *node;
   GType type;
 
+  /* Ensure GLib is initialized first, see
+   * https://bugzilla.gnome.org/show_bug.cgi?id=756139
+   */
+  GLIB_PRIVATE_CALL (glib_init) ();
+
   G_WRITE_LOCK (&type_rw_lock);
 
   /* setup GObject library wide debugging flags */


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]