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
This commit is contained in:
Matthias Clasen 2015-10-06 20:09:08 -04:00
parent e0dce8a9ae
commit 8d83aace10

View File

@ -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 */