From d5290e93a8ce401dc06f871eec954491290356a1 Mon Sep 17 00:00:00 2001 From: Stenzek Date: Fri, 5 Apr 2024 20:08:36 +1000 Subject: [PATCH] Qt: Fix crash on shutdown settings save --- pcsx2-qt/QtHost.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/pcsx2-qt/QtHost.cpp b/pcsx2-qt/QtHost.cpp index 64d4fa945f042..d2479deb7911b 100644 --- a/pcsx2-qt/QtHost.cpp +++ b/pcsx2-qt/QtHost.cpp @@ -1298,13 +1298,17 @@ void QtHost::SaveSettings() pxAssertRel(!g_emu_thread->isOnEmuThread(), "Saving should happen on the UI thread."); { + Error error; auto lock = Host::GetSettingsLock(); - if (!s_base_settings_interface->Save()) - Console.Error("Failed to save settings."); + if (!s_base_settings_interface->Save(&error)) + Console.ErrorFmt("Failed to save settings: {}", error.GetDescription()); } - s_settings_save_timer->deleteLater(); - s_settings_save_timer.release(); + if (s_settings_save_timer) + { + s_settings_save_timer->deleteLater(); + s_settings_save_timer.release(); + } } void Host::CommitBaseSettingChanges()