From dc1b961c09e009d53fcf3e74f5ce0f2375ec5dcc Mon Sep 17 00:00:00 2001 From: Dentomologist Date: Fri, 27 Sep 2024 12:05:01 -0700 Subject: [PATCH] VideoBackendBase: Only populate backend info when uninitialized Prevent potential issues when creating the Graphics window (and thus calling PopulateBackendInfo) while the core state is Stopping, like we already do while it's Starting or Running. --- Source/Core/VideoCommon/VideoBackendBase.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Source/Core/VideoCommon/VideoBackendBase.cpp b/Source/Core/VideoCommon/VideoBackendBase.cpp index ab5e6c9fe6..8124c2eeb3 100644 --- a/Source/Core/VideoCommon/VideoBackendBase.cpp +++ b/Source/Core/VideoCommon/VideoBackendBase.cpp @@ -284,9 +284,9 @@ void VideoBackendBase::ActivateBackend(const std::string& name) void VideoBackendBase::PopulateBackendInfo(const WindowSystemInfo& wsi) { - // If the core is running, the backend info will have been populated already. If we did it here, - // the UI thread could race with the GPU thread. - if (Core::IsRunningOrStarting(Core::System::GetInstance())) + // If the core has been initialized, the backend info will have been populated already. Doing it + // again would be unnecessary and could cause the UI thread to race with the GPU thread. + if (Core::GetState(Core::System::GetInstance()) != Core::State::Uninitialized) return; g_Config.Refresh();