File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -514,8 +514,13 @@ struct local_internals {
514514
515515// / Works like `get_internals`, but for things which are locally registered.
516516inline local_internals &get_local_internals () {
517- static local_internals locals;
518- return locals;
517+ // Current static can be created in the interpreter finalization routine. If the later will be
518+ // destroyed in another static variable destructor, creation of this static there will cause
519+ // static deinitialization fiasco. In order to avoid it we avoid destruction of the
520+ // local_internals static. One can read more about the problem and current solution here:
521+ // https://google.github.io/styleguide/cppguide.html#Static_and_Global_Variables
522+ static auto *locals = new local_internals ();
523+ return *locals;
519524}
520525
521526// / Constructs a std::string with the given arguments, stores it in `internals`, and returns its
You can’t perform that action at this time.
0 commit comments