Exemplo n.º 1
0
PlatformDisplay& PlatformDisplay::sharedDisplay()
{
    static std::once_flag onceFlag;
    static std::unique_ptr<PlatformDisplay> display;
    std::call_once(onceFlag, []{
        display = createPlatformDisplay();
    });
    return *display;
}
Exemplo n.º 2
0
PlatformDisplay& PlatformDisplay::sharedDisplay()
{
    static std::once_flag onceFlag;
#if COMPILER(CLANG)
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wexit-time-destructors"
#endif
    static std::unique_ptr<PlatformDisplay> display;
#if COMPILER(CLANG)
#pragma clang diagnostic pop
#endif
    std::call_once(onceFlag, []{
        display = createPlatformDisplay();
    });
    return *display;
}