mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-29 04:08:55 +00:00
qt: unregister Settings' DevicesChanged callback during shutdown
fixes a crash on close
This commit is contained in:
parent
f7f47d3cd0
commit
27dd2c4aa4
3 changed files with 14 additions and 2 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue