gsdump: force close-shutdown when gsdump is the callee

This commit is contained in:
Gauvain 'GovanifY' Roussel-Tarbouriech 2021-03-08 15:16:10 +01:00 committed by Kojin
parent f407c5aabd
commit 501225c630
4 changed files with 8 additions and 7 deletions

View File

@ -29,6 +29,7 @@
#endif
#include "Utilities/pxStreams.h"
#include "gui/Dialogs/ModalPopups.h"
#include "svnrev.h"
#include "ConsoleLogger.h"
@ -901,7 +902,7 @@ void SysCorePlugins::Close( PluginsEnum_t pid )
{
pxAssert( (uint)pid < PluginId_Count );
if( !IsOpen(pid) ) return;
if (!(IsOpen(pid) || GSDump::isRunning) ) return;
if( !GetMTGS().IsSelf() ) // stop the spam!
Console.Indent().WriteLn( "Closing %s", tbl_PluginInfo[pid].shortname );
@ -920,7 +921,7 @@ void SysCorePlugins::Close( PluginsEnum_t pid )
void SysCorePlugins::Close()
{
if( !NeedsClose() ) return; // Spam stopper; returns before writing any logs. >_<
if( !(NeedsClose() || GSDump::isRunning) ) return; // Spam stopper; returns before writing any logs. >_<
// Close plugins in reverse order of the initialization procedure, which
// ensures the GS gets closed last.
@ -1010,7 +1011,7 @@ bool SysCorePlugins::Init()
//
bool SysCorePlugins::Shutdown()
{
if( !NeedsShutdown() ) return false;
if( !NeedsShutdown()) return false;
pxAssertDev( !NeedsClose(), "Cannot shut down plugins prior to Close()" );

View File

@ -24,6 +24,7 @@
#include "Plugins.h"
#include "GS.h"
#include "AppConfig.h"
#include "gui/Dialogs/ModalPopups.h"
using namespace Threading;
@ -328,7 +329,7 @@ bool AppCorePlugins::Shutdown()
void AppCorePlugins::Close()
{
if (!NeedsClose())
if (!(NeedsClose() || GSDump::isRunning))
return;
PostPluginStatus(CorePlugins_Closing);

View File

@ -68,7 +68,6 @@
#undef ECX
#include <wx/osx/private.h> // needed to implement the app!
#endif
wxIMPLEMENT_APP(Pcsx2App);
std::unique_ptr<AppConfig> g_Conf;

View File

@ -178,7 +178,6 @@ void Dialogs::GSDumpDialog::RunDump(wxCommandEvent& event)
m_selection->Enable();
m_vsync->Enable();
m_run->Disable();
GetCorePlugins().Shutdown();
m_thread->m_dump_file = std::make_unique<pxInputStream>(m_selected_dump, new wxFFileInputStream(m_selected_dump));
@ -807,13 +806,14 @@ void Dialogs::GSDumpDialog::GSThread::ExecuteTaskInThread()
{
if (!window->IsShown())
{
GetCorePlugins().Close();
GetCorePlugins().Shutdown();
sApp.CloseGsPanel();
GSDump::isRunning = false;
}
}
}
GetCorePlugins().Close();
OnStop();
return;
}