| 93 | } |
| 94 | |
| 95 | std::shared_ptr<streamfx::configuration> streamfx::configuration::instance() |
| 96 | { |
| 97 | static std::weak_ptr<streamfx::configuration> winst; |
| 98 | static std::mutex mtx; |
| 99 | |
| 100 | std::unique_lock<decltype(mtx)> lock(mtx); |
| 101 | auto instance = winst.lock(); |
| 102 | if (!instance) { |
| 103 | instance = std::shared_ptr<streamfx::configuration>(new streamfx::configuration()); |
| 104 | winst = instance; |
| 105 | } |
| 106 | return instance; |
| 107 | } |
| 108 | |
| 109 | static std::shared_ptr<streamfx::configuration> loader_instance; |
| 110 |