In C++ Singleton design pattern, obecalp mentioned that:
For many larger programs, especially those with dynamic libraries. Any global or static object that's none primitive can lead to segfaults/crashes upon program exit on many platforms due to order of destruction issues upon libraries unloading. This is one of the reasons many coding conventions (including Google's) ban the use of non-trivial static and global objects.
Can someone elaborate why this can happen? Maybe an example to explain it?