On 03/28/2016 03:50 AM, Georg Baum wrote: > Richard Heck wrote: > >> On 03/27/2016 03:09 PM, Jean-Marc Lasgouttes wrote: >>> Therefore, if can happen than plain_insetlayout_ is initialized before >>> sane_font and inherit_font have been initialized, which creates the >>> problems that Kornel sees. >>> >>> What is the right construct to avoid this problem? >> Idea attached. > Could you explain why it helps? It is not obvious to me, we still have a > static variable.
In this case, the static variable is not initalized until the first time we go through that function, and by then sane_font and inherit_font will have been inialized. https://isocpp.org/wiki/faq/ctors#static-init-order I guess we should audit all the static member variables. Richard