MCPcopy Create free account
hub / github.com/Vhonowslend/StreamFX-Public / instance

Method instance

source/updater.cpp:524–537  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

522}
523
524std::shared_ptr<streamfx::updater> streamfx::updater::instance()
525{
526 static std::weak_ptr<streamfx::updater> _instance;
527 static std::mutex _lock;
528
529 std::lock_guard<std::mutex> lock(_lock);
530 if (_instance.expired()) {
531 auto ptr = std::make_shared<streamfx::updater>();
532 _instance = ptr;
533 return ptr;
534 } else {
535 return _instance.lock();
536 }
537}

Callers

nothing calls this directly

Calls 2

expiredMethod · 0.80
lockMethod · 0.80

Tested by

no test coverage detected