Skip to content
  • Philip Withnall's avatar
    gquark: Document that some functions can’t initialise C++ globals · a66ae5cd
    Philip Withnall authored
    
    
    Any function which requires g_quark_init() to have been called first
    cannot be called before the library constructors have finished running.
    In particular, this means that g_quark_from_static_string() or
    g_intern_static_string() can’t be used to initialize C++ globals.
    
    Do this, rather than adding a conditional call to g_quark_init() to all
    these functions, because such a call was previously removed from the
    functions to improve performance (quarks are used a lot in the
    implementation of GObject for properties and signals). That’s the reason
    why g_quark_init() was originally moved out to a library constructor.
    
    Signed-off-by: default avatarPhilip Withnall <withnall@endlessm.com>
    
    Fixes: #1177
    a66ae5cd