mirror of
				https://github.com/PabloMK7/citra.git
				synced 2025-10-31 05:40:04 +00:00 
			
		
		
		
	Frontend PR fixes (#6378)
* citra_qt: Check if renderer is null * core: Fix dynarmic use-after-free error * bootmanager: Add current context check in DoneCurrent * Loading a save state would destroy the frame dumper class, which contains a shared context. That context would call DoneCurrent without checking if it was actually bound or not, resulting in crashes when calling opengl functions * externals: Correct glad readme * common: Log renderer debug setting * citra: Make lambda lower case * Consistency with review comments on the PR * video_core: Kill more global state * GetResolutionScaleFactor would be called somewhere in the renderer constructor chain but it relies on the yet unitialized g_renderer, resulting in crashes when the resolution scale is set to auto. Rather than adding a workaround, let's kill this global state to fix this for good
This commit is contained in:
		
							parent
							
								
									5346ca27b5
								
							
						
					
					
						commit
						ffc95eb59b
					
				
					 17 changed files with 102 additions and 93 deletions
				
			
		|  | @ -74,8 +74,7 @@ System::~System() = default; | |||
| 
 | ||||
| System::ResultStatus System::RunLoop(bool tight_loop) { | ||||
|     status = ResultStatus::Success; | ||||
|     if (std::any_of(cpu_cores.begin(), cpu_cores.end(), | ||||
|                     [](std::shared_ptr<ARM_Interface> ptr) { return ptr == nullptr; })) { | ||||
|     if (!IsPoweredOn()) { | ||||
|         return ResultStatus::ErrorNotInitialized; | ||||
|     } | ||||
| 
 | ||||
|  | @ -435,7 +434,7 @@ System::ResultStatus System::Init(Frontend::EmuWindow& emu_window, | |||
| 
 | ||||
|     LOG_DEBUG(Core, "Initialized OK"); | ||||
| 
 | ||||
|     initalized = true; | ||||
|     is_powered_on = true; | ||||
| 
 | ||||
|     return ResultStatus::Success; | ||||
| } | ||||
|  | @ -537,6 +536,8 @@ void System::Shutdown(bool is_deserializing) { | |||
|                                 perf_stats ? perf_stats->GetMeanFrametime() : 0); | ||||
| 
 | ||||
|     // Shutdown emulation session
 | ||||
|     is_powered_on = false; | ||||
| 
 | ||||
|     VideoCore::Shutdown(); | ||||
|     HW::Shutdown(); | ||||
|     if (!is_deserializing) { | ||||
|  |  | |||
|  | @ -4,6 +4,7 @@ | |||
| 
 | ||||
| #pragma once | ||||
| 
 | ||||
| #include <atomic> | ||||
| #include <memory> | ||||
| #include <mutex> | ||||
| #include <string> | ||||
|  | @ -151,10 +152,7 @@ public: | |||
|      * @returns True if the emulated system is powered on, otherwise false. | ||||
|      */ | ||||
|     [[nodiscard]] bool IsPoweredOn() const { | ||||
|         return cpu_cores.size() > 0 && | ||||
|                std::all_of(cpu_cores.begin(), cpu_cores.end(), | ||||
|                            [](std::shared_ptr<ARM_Interface> ptr) { return ptr != nullptr; }); | ||||
|         ; | ||||
|         return is_powered_on; | ||||
|     } | ||||
| 
 | ||||
|     /**
 | ||||
|  | @ -383,7 +381,7 @@ private: | |||
| private: | ||||
|     static System s_instance; | ||||
| 
 | ||||
|     bool initalized = false; | ||||
|     std::atomic_bool is_powered_on{}; | ||||
| 
 | ||||
|     ResultStatus status = ResultStatus::Success; | ||||
|     std::string status_details = ""; | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue