diff options
| author | 2021-10-14 14:21:15 -0400 | |
|---|---|---|
| committer | 2021-10-15 17:34:48 -0400 | |
| commit | b6719094e69bba468ecbc275fd892c4d412b92a3 (patch) | |
| tree | 633d5621300ec64c6ed2a2e7cfdff587d5462c0a /src/core/core.cpp | |
| parent | Merge pull request #7183 from FearlessTobi/translation-ci (diff) | |
| download | yuzu-b6719094e69bba468ecbc275fd892c4d412b92a3.tar.gz yuzu-b6719094e69bba468ecbc275fd892c4d412b92a3.tar.xz yuzu-b6719094e69bba468ecbc275fd892c4d412b92a3.zip | |
core: Remove static system instance
Diffstat (limited to 'src/core/core.cpp')
| -rw-r--r-- | src/core/core.cpp | 15 |
1 files changed, 1 insertions, 14 deletions
diff --git a/src/core/core.cpp b/src/core/core.cpp index bb268a319..ae1d56b27 100644 --- a/src/core/core.cpp +++ b/src/core/core.cpp | |||
| @@ -428,21 +428,8 @@ struct System::Impl { | |||
| 428 | }; | 428 | }; |
| 429 | 429 | ||
| 430 | System::System() : impl{std::make_unique<Impl>(*this)} {} | 430 | System::System() : impl{std::make_unique<Impl>(*this)} {} |
| 431 | System::~System() = default; | ||
| 432 | |||
| 433 | System& System::GetInstance() { | ||
| 434 | if (!s_instance) { | ||
| 435 | throw std::runtime_error("Using System instance before its initialization"); | ||
| 436 | } | ||
| 437 | return *s_instance; | ||
| 438 | } | ||
| 439 | 431 | ||
| 440 | void System::InitializeGlobalInstance() { | 432 | System::~System() = default; |
| 441 | if (s_instance) { | ||
| 442 | throw std::runtime_error("Reinitializing Global System instance."); | ||
| 443 | } | ||
| 444 | s_instance = std::unique_ptr<System>(new System); | ||
| 445 | } | ||
| 446 | 433 | ||
| 447 | CpuManager& System::GetCpuManager() { | 434 | CpuManager& System::GetCpuManager() { |
| 448 | return impl->cpu_manager; | 435 | return impl->cpu_manager; |