HostInterface: Fix a possible crash when renderer recreation fails

This commit is contained in:
Connor McLaughlin 2020-10-27 11:57:41 +10:00
parent a1064f33b3
commit be3dd3e06f
1 changed files with 9 additions and 9 deletions

View File

@ -551,6 +551,15 @@ void HostInterface::SaveSettings(SettingsInterface& si)
void HostInterface::CheckForSettingsChanges(const Settings& old_settings)
{
if (System::IsValid() && (g_settings.gpu_renderer != old_settings.gpu_renderer ||
g_settings.gpu_use_debug_device != old_settings.gpu_use_debug_device))
{
AddFormattedOSDMessage(5.0f, TranslateString("OSDMessage", "Switching to %s%s GPU renderer."),
Settings::GetRendererName(g_settings.gpu_renderer),
g_settings.gpu_use_debug_device ? " (debug)" : "");
RecreateSystem();
}
if (System::IsValid())
{
if (g_settings.cpu_overclock_active != old_settings.cpu_overclock_active ||
@ -561,15 +570,6 @@ void HostInterface::CheckForSettingsChanges(const Settings& old_settings)
System::UpdateOverclock();
}
if (g_settings.gpu_renderer != old_settings.gpu_renderer ||
g_settings.gpu_use_debug_device != old_settings.gpu_use_debug_device)
{
AddFormattedOSDMessage(5.0f, TranslateString("OSDMessage", "Switching to %s%s GPU renderer."),
Settings::GetRendererName(g_settings.gpu_renderer),
g_settings.gpu_use_debug_device ? " (debug)" : "");
RecreateSystem();
}
if (g_settings.audio_backend != old_settings.audio_backend ||
g_settings.audio_buffer_size != old_settings.audio_buffer_size)
{