Qt: Fix crash on shutdown settings save

This commit is contained in:
Stenzek 2024-04-05 20:08:36 +10:00 committed by Connor McLaughlin
parent 056a8d0274
commit d5290e93a8
1 changed files with 8 additions and 4 deletions

View File

@ -1298,13 +1298,17 @@ void QtHost::SaveSettings()
pxAssertRel(!g_emu_thread->isOnEmuThread(), "Saving should happen on the UI thread."); pxAssertRel(!g_emu_thread->isOnEmuThread(), "Saving should happen on the UI thread.");
{ {
Error error;
auto lock = Host::GetSettingsLock(); auto lock = Host::GetSettingsLock();
if (!s_base_settings_interface->Save()) if (!s_base_settings_interface->Save(&error))
Console.Error("Failed to save settings."); Console.ErrorFmt("Failed to save settings: {}", error.GetDescription());
} }
if (s_settings_save_timer)
{
s_settings_save_timer->deleteLater(); s_settings_save_timer->deleteLater();
s_settings_save_timer.release(); s_settings_save_timer.release();
}
} }
void Host::CommitBaseSettingChanges() void Host::CommitBaseSettingChanges()