What is possibly happening in this C++ Singleton used in a multi-threaded code and how to possibly fix the behavior?

前端 未结 0 1962
情歌与酒
情歌与酒 2020-12-30 00:35

There is this simple Singleton function:

const AppConfig& AppConfig::Singleton()
{
    static AppConfig appConfig{ configPath_ };

    return appConfig;
}         


        
相关标签:
回答
  • 消灭零回复
提交回复
热议问题