gs: fix freeze on close all windows

This commit is contained in:
Gauvain 'GovanifY' Roussel-Tarbouriech 2021-06-20 14:12:42 +02:00 committed by Kojin
parent 7597ac12b6
commit 483f28044b

View File

@ -36,6 +36,8 @@
#include "Recording/InputRecordingControls.h" #include "Recording/InputRecordingControls.h"
#endif #endif
extern std::atomic_bool init_gspanel;
// ------------------------------------------------------------------------ // ------------------------------------------------------------------------
wxMenu* MainEmuFrame::MakeStatesSubMenu(int baseid, int loadBackupId) const wxMenu* MainEmuFrame::MakeStatesSubMenu(int baseid, int loadBackupId) const
{ {
@ -154,6 +156,10 @@ bool MainEmuFrame::Destroy()
// //
void MainEmuFrame::OnCloseWindow(wxCloseEvent& evt) void MainEmuFrame::OnCloseWindow(wxCloseEvent& evt)
{ {
// the main thread is busy suspending everything, so let's not try to call it
// when closing the emulator
init_gspanel = false;
if (IsBeingDeleted()) if (IsBeingDeleted())
return; return;