mirror of
				https://github.com/PabloMK7/citra.git
				synced 2025-10-31 05:40:04 +00:00 
			
		
		
		
	logging: Address some issues
This commit is contained in:
		
							parent
							
								
									9c3e2d0f50
								
							
						
					
					
						commit
						ba98bf058a
					
				
					 11 changed files with 19 additions and 34 deletions
				
			
		|  | @ -52,6 +52,8 @@ | |||
| 
 | ||||
| namespace Core { | ||||
| 
 | ||||
| /*static*/ System System::s_instance; | ||||
| 
 | ||||
| template <> | ||||
| Core::System& Global() { | ||||
|     return System::GetInstance(); | ||||
|  | @ -69,20 +71,6 @@ Core::Timing& Global() { | |||
| 
 | ||||
| System::~System() = default; | ||||
| 
 | ||||
| System& System::GetInstance() { | ||||
|     if (!s_instance) { | ||||
|         throw std::runtime_error("Using System instance before its initialization"); | ||||
|     } | ||||
|     return *s_instance; | ||||
| } | ||||
| 
 | ||||
| void System::InitializeGlobalInstance() { | ||||
|     if (s_instance) { | ||||
|         throw std::runtime_error("Reinitializing Global System instance."); | ||||
|     } | ||||
|     s_instance = std::unique_ptr<System>(new System); | ||||
| } | ||||
| 
 | ||||
| System::ResultStatus System::RunLoop(bool tight_loop) { | ||||
|     status = ResultStatus::Success; | ||||
|     if (!IsPoweredOn()) { | ||||
|  |  | |||
|  | @ -73,9 +73,9 @@ public: | |||
|      * Gets the instance of the System singleton class. | ||||
|      * @returns Reference to the instance of the System singleton class. | ||||
|      */ | ||||
|     [[nodiscard]] static System& GetInstance(); | ||||
| 
 | ||||
|     static void InitializeGlobalInstance(); | ||||
|     [[nodiscard]] static System& GetInstance() { | ||||
|         return s_instance; | ||||
|     } | ||||
| 
 | ||||
|     /// Enumeration representing the return values of the System Initialize and Load process.
 | ||||
|     enum class ResultStatus : u32 { | ||||
|  | @ -392,7 +392,7 @@ private: | |||
|     std::unique_ptr<Core::ExclusiveMonitor> exclusive_monitor; | ||||
| 
 | ||||
| private: | ||||
|     inline static std::unique_ptr<System> s_instance; | ||||
|     static System s_instance; | ||||
| 
 | ||||
|     std::atomic_bool is_powered_on{}; | ||||
| 
 | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue