mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-22 22:00:39 -06:00
qt: unregister Settings' DevicesChanged callback during shutdown
fixes a crash on close
This commit is contained in:
@ -69,7 +69,7 @@ Settings::Settings()
|
||||
}
|
||||
});
|
||||
|
||||
g_controller_interface.RegisterDevicesChangedCallback([this] {
|
||||
m_hotplug_callback_handle = g_controller_interface.RegisterDevicesChangedCallback([this] {
|
||||
if (Host::GetInstance()->IsHostThread())
|
||||
{
|
||||
emit DevicesChanged();
|
||||
@ -90,6 +90,11 @@ Settings::Settings()
|
||||
|
||||
Settings::~Settings() = default;
|
||||
|
||||
void Settings::UnregisterDevicesChangedCallback()
|
||||
{
|
||||
g_controller_interface.UnregisterDevicesChangedCallback(m_hotplug_callback_handle);
|
||||
}
|
||||
|
||||
Settings& Settings::Instance()
|
||||
{
|
||||
static Settings settings;
|
||||
|
Reference in New Issue
Block a user