diff options
| author | 2018-07-18 18:15:16 -0400 | |
|---|---|---|
| committer | 2018-07-18 18:18:27 -0400 | |
| commit | 10d2ab80989e1362fe9cc206e0708d7aeeda5d3a (patch) | |
| tree | e3f4f9ea584b2637c7f3ccccaef5df2e4df3bfa7 | |
| parent | core: Don't construct instance of Core::System, just to access its live instance (diff) | |
| download | yuzu-10d2ab80989e1362fe9cc206e0708d7aeeda5d3a.tar.gz yuzu-10d2ab80989e1362fe9cc206e0708d7aeeda5d3a.tar.xz yuzu-10d2ab80989e1362fe9cc206e0708d7aeeda5d3a.zip | |
core: Make System's default constructor private
This makes it a compilation error to construct additional instances of
the System class directly, preventing accidental wasteful constructions
over and over.
Diffstat (limited to '')
| -rw-r--r-- | src/core/core.cpp | 2 | ||||
| -rw-r--r-- | src/core/core.h | 2 |
2 files changed, 4 insertions, 0 deletions
diff --git a/src/core/core.cpp b/src/core/core.cpp index 7936c5b56..ae3849a36 100644 --- a/src/core/core.cpp +++ b/src/core/core.cpp | |||
| @@ -25,6 +25,8 @@ namespace Core { | |||
| 25 | 25 | ||
| 26 | /*static*/ System System::s_instance; | 26 | /*static*/ System System::s_instance; |
| 27 | 27 | ||
| 28 | System::System() = default; | ||
| 29 | |||
| 28 | System::~System() = default; | 30 | System::~System() = default; |
| 29 | 31 | ||
| 30 | /// Runs a CPU core while the system is powered on | 32 | /// Runs a CPU core while the system is powered on |
diff --git a/src/core/core.h b/src/core/core.h index f90f085ad..c6f69f001 100644 --- a/src/core/core.h +++ b/src/core/core.h | |||
| @@ -168,6 +168,8 @@ public: | |||
| 168 | } | 168 | } |
| 169 | 169 | ||
| 170 | private: | 170 | private: |
| 171 | System(); | ||
| 172 | |||
| 171 | /// Returns the currently running CPU core | 173 | /// Returns the currently running CPU core |
| 172 | Cpu& CurrentCpuCore(); | 174 | Cpu& CurrentCpuCore(); |
| 173 | 175 | ||