diff --git a/gobject/gtype.c b/gobject/gtype.c index ded0acee28dccf777fa4b79d24c13d7dcbd6a511..190423dce54c990a2a99288f59436ae88ba0f466 100644 --- a/gobject/gtype.c +++ b/gobject/gtype.c @@ -4426,13 +4426,25 @@ g_type_init (void) g_assert_type_system_initialized (); } -static void +#ifdef GOBJECT_STATIC_COMPILATION +void gobject_init (void); + +#else +static +#endif +void gobject_init (void) { const gchar *env_string; GTypeInfo info; TypeNode *node; GType type G_GNUC_UNUSED /* when compiling with G_DISABLE_ASSERT */; + static gboolean gobject_inited = FALSE; + + if (gobject_inited) + return; + + gobject_inited = TRUE; /* Ensure GLib is initialized first, see * https://bugzilla.gnome.org/show_bug.cgi?id=756139