CommonHostInterface: Fix crash on shutdown when using save state selector

This commit is contained in:
Connor McLaughlin 2020-09-06 21:03:27 +10:00
parent e731c87757
commit 9bb278b166
3 changed files with 7 additions and 9 deletions

View file

@ -48,7 +48,11 @@ bool HostInterface::Initialize()
return true;
}
void HostInterface::Shutdown() {}
void HostInterface::Shutdown()
{
if (!System::IsShutdown())
System::Shutdown();
}
void HostInterface::CreateAudioStream()
{

View file

@ -87,18 +87,10 @@ void CommonHostInterface::Shutdown()
{
HostInterface::Shutdown();
// this has gpu objects so it has to come first
m_save_state_selector_ui.reset();
#ifdef WITH_DISCORD_PRESENCE
ShutdownDiscordPresence();
#endif
System::Shutdown();
m_audio_stream.reset();
if (m_display)
ReleaseHostDisplay();
if (m_controller_interface)
{
m_controller_interface->Shutdown();
@ -177,6 +169,7 @@ void CommonHostInterface::PauseSystem(bool paused)
void CommonHostInterface::DestroySystem()
{
SetTimerResolutionIncreased(false);
m_save_state_selector_ui->Close();
HostInterface::DestroySystem();
}

View file

@ -31,6 +31,7 @@ void SaveStateSelectorUI::Close()
return;
m_open = false;
ClearList();
}
void SaveStateSelectorUI::ClearList()