GNOME Bugzilla – Bug 757083
Initialization via library ctors is breaking single library use case
Last modified: 2015-10-25 09:30:02 UTC
Background: For GStreamer on Android we build all of GLib, GStreamer, etc in a single shared library. And on iOS we do static linking of everything into a single executable. So, nowadays GLib, GObject, etc are initialized via library ctors. The order in which those are called is completely undefined. Now in the above two cases we will have the GLib and GObject library ctors in the same shared library or executable. Unfortunately with 2.46, now the GObject library ctor is called before the GLib one, which causes the GObject one to assert. If you really want to use library ctors for all this, you need to ensure that dependencies between them are explicitly handled. That is, the GObject one must call the GLib one first
In order to cater to other standard C libraries, the GObject constructor is now also initializing GLib explicitly. *** This bug has been marked as a duplicate of bug 756139 ***