mirror of https://github.com/PCSX2/pcsx2.git
GUI: Resolve issue causing a crash when using `Close All Windows` while a game is running
This commit is contained in:
parent
88983caaba
commit
083380297f
|
@ -363,7 +363,8 @@ bool AppCorePlugins::OpenPlugin_GS()
|
|||
void AppCorePlugins::ClosePlugin_GS()
|
||||
{
|
||||
_parent::ClosePlugin_GS();
|
||||
if( GetMTGS().IsSelf() && GSopen2 ) sApp.CloseGsPanel();
|
||||
if (CloseViewportWithPlugins && GetMTGS().IsSelf() && GSopen2)
|
||||
sApp.CloseGsPanel();
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -1024,13 +1024,29 @@ void Pcsx2App::OpenGsPanel()
|
|||
|
||||
void Pcsx2App::CloseGsPanel()
|
||||
{
|
||||
if( AppRpc_TryInvoke( &Pcsx2App::CloseGsPanel ) ) return;
|
||||
if (AppRpc_TryInvoke(&Pcsx2App::CloseGsPanel))
|
||||
return;
|
||||
|
||||
if (CloseViewportWithPlugins)
|
||||
{
|
||||
if (GSFrame* gsFrame = GetGsFramePtr())
|
||||
if (GSPanel* woot = gsFrame->GetViewport())
|
||||
woot->Destroy();
|
||||
if (GSPanel* woot = gsFrame->GetViewport())
|
||||
woot->Destroy();
|
||||
}
|
||||
}
|
||||
|
||||
void Pcsx2App::OnGsFrameClosed(wxWindowID id)
|
||||
{
|
||||
if ((m_id_GsFrame == wxID_ANY) || (m_id_GsFrame != id))
|
||||
return;
|
||||
|
||||
CoreThread.Suspend();
|
||||
|
||||
if (!m_UseGUI)
|
||||
{
|
||||
// The user is prompted before suspending (at Sys_Suspend() ), because
|
||||
// right now there's no way to resume from suspend without GUI.
|
||||
PrepForExit();
|
||||
}
|
||||
#ifndef DISABLE_RECORDING
|
||||
// Disable recording controls that only make sense if the game is running
|
||||
|
@ -1040,20 +1056,6 @@ void Pcsx2App::CloseGsPanel()
|
|||
#endif
|
||||
}
|
||||
|
||||
void Pcsx2App::OnGsFrameClosed( wxWindowID id )
|
||||
{
|
||||
if( (m_id_GsFrame == wxID_ANY) || (m_id_GsFrame != id) ) return;
|
||||
|
||||
CoreThread.Suspend();
|
||||
|
||||
if( !m_UseGUI )
|
||||
{
|
||||
// The user is prompted before suspending (at Sys_Suspend() ), because
|
||||
// right now there's no way to resume from suspend without GUI.
|
||||
PrepForExit();
|
||||
}
|
||||
}
|
||||
|
||||
void Pcsx2App::OnProgramLogClosed( wxWindowID id )
|
||||
{
|
||||
if( (m_id_ProgramLogBox == wxID_ANY) || (m_id_ProgramLogBox != id) ) return;
|
||||
|
|
Loading…
Reference in New Issue