summaryrefslogtreecommitdiff
path: root/src/core/core.cpp
diff options
context:
space:
mode:
authorGravatar bunnei2021-08-24 18:31:27 -0700
committerGravatar GitHub2021-08-24 18:31:27 -0700
commit4654fb96b0e2eb1b57857ae7f0438341fb2f9292 (patch)
tree4b257caf10eb6e7dfd2113671a7ebdcd845dcf3b /src/core/core.cpp
parentMerge pull request #6878 from BreadFish64/optimize-GetHostThreadID (diff)
parentlogging: Fix log filter during initialization (diff)
downloadyuzu-4654fb96b0e2eb1b57857ae7f0438341fb2f9292.tar.gz
yuzu-4654fb96b0e2eb1b57857ae7f0438341fb2f9292.tar.xz
yuzu-4654fb96b0e2eb1b57857ae7f0438341fb2f9292.zip
Merge pull request #6917 from ameerj/log-init-fix
logging: Fix log filter during initialization
Diffstat (limited to 'src/core/core.cpp')
-rw-r--r--src/core/core.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/core/core.cpp b/src/core/core.cpp
index b0dc594d4..5893a86bf 100644
--- a/src/core/core.cpp
+++ b/src/core/core.cpp
@@ -4,6 +4,7 @@
4 4
5#include <array> 5#include <array>
6#include <atomic> 6#include <atomic>
7#include <exception>
7#include <memory> 8#include <memory>
8#include <utility> 9#include <utility>
9 10
@@ -423,9 +424,16 @@ struct System::Impl {
423System::System() : impl{std::make_unique<Impl>(*this)} {} 424System::System() : impl{std::make_unique<Impl>(*this)} {}
424System::~System() = default; 425System::~System() = default;
425 426
427System& System::GetInstance() {
428 if (!s_instance) {
429 throw std::runtime_error("Using System instance before its initialization");
430 }
431 return *s_instance;
432}
433
426void System::InitializeGlobalInstance() { 434void System::InitializeGlobalInstance() {
427 if (s_instance) { 435 if (s_instance) {
428 abort(); 436 throw std::runtime_error("Reinitializing Global System instance.");
429 } 437 }
430 s_instance = std::unique_ptr<System>(new System); 438 s_instance = std::unique_ptr<System>(new System);
431} 439}