diff --git a/Source/Core/DolphinQt/Settings.cpp b/Source/Core/DolphinQt/Settings.cpp index bc807c7d26..4a0bea42b9 100644 --- a/Source/Core/DolphinQt/Settings.cpp +++ b/Source/Core/DolphinQt/Settings.cpp @@ -59,7 +59,7 @@ Settings::Settings() }); }); - Config::AddConfigChangedCallback([this] { + m_config_changed_callback_id = Config::AddConfigChangedCallback([this] { static std::atomic do_once{true}; if (do_once.exchange(false)) { @@ -94,7 +94,10 @@ Settings::Settings() }); } -Settings::~Settings() = default; +Settings::~Settings() +{ + Config::RemoveConfigChangedCallback(m_config_changed_callback_id); +} void Settings::UnregisterDevicesChangedCallback() { diff --git a/Source/Core/DolphinQt/Settings.h b/Source/Core/DolphinQt/Settings.h index b6c50c9404..6a57884a27 100644 --- a/Source/Core/DolphinQt/Settings.h +++ b/Source/Core/DolphinQt/Settings.h @@ -10,6 +10,7 @@ #include #include +#include "Common/Config/Config.h" #include "Core/Config/MainSettings.h" #include "DiscIO/Enums.h" #include "InputCommon/ControllerInterface/ControllerInterface.h" @@ -232,6 +233,7 @@ private: std::shared_ptr m_client; std::shared_ptr m_server; ControllerInterface::HotplugCallbackHandle m_hotplug_callback_handle; + Config::ConfigChangedCallbackID m_config_changed_callback_id; }; Q_DECLARE_METATYPE(Core::State);