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 #endif
#include "Utilities/pxStreams.h" #include "Utilities/pxStreams.h"
#include "gui/Dialogs/ModalPopups.h"
#include "svnrev.h" #include "svnrev.h"
#include "ConsoleLogger.h" #include "ConsoleLogger.h"
@ -901,7 +902,7 @@ void SysCorePlugins::Close( PluginsEnum_t pid )
{ {
pxAssert( (uint)pid < PluginId_Count ); pxAssert( (uint)pid < PluginId_Count );
if( !IsOpen(pid) ) return; if (!(IsOpen(pid) || GSDump::isRunning) ) return;
if( !GetMTGS().IsSelf() ) // stop the spam! if( !GetMTGS().IsSelf() ) // stop the spam!
Console.Indent().WriteLn( "Closing %s", tbl_PluginInfo[pid].shortname ); Console.Indent().WriteLn( "Closing %s", tbl_PluginInfo[pid].shortname );
@ -920,7 +921,7 @@ void SysCorePlugins::Close( PluginsEnum_t pid )
void SysCorePlugins::Close() 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 // Close plugins in reverse order of the initialization procedure, which
// ensures the GS gets closed last. // ensures the GS gets closed last.

View File

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

View File

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

View File

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