From 8d83aace106b6832629a3e05f49d074a4288c8df Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Tue, 6 Oct 2015 20:09:08 -0400 Subject: [PATCH] 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 file changed, 6 insertions(+) diff --git a/gobject/gtype.c b/gobject/gtype.c index 990002b3b..be1922cd5 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 */