From 483f28044be8f7c0fe6527f9e7e207278fbe97c1 Mon Sep 17 00:00:00 2001 From: Gauvain 'GovanifY' Roussel-Tarbouriech Date: Sun, 20 Jun 2021 14:12:42 +0200 Subject: [PATCH] gs: fix freeze on close all windows --- pcsx2/gui/MainFrame.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pcsx2/gui/MainFrame.cpp b/pcsx2/gui/MainFrame.cpp index b3cf960b96..ac71f02ca4 100644 --- a/pcsx2/gui/MainFrame.cpp +++ b/pcsx2/gui/MainFrame.cpp @@ -36,6 +36,8 @@ #include "Recording/InputRecordingControls.h" #endif +extern std::atomic_bool init_gspanel; + // ------------------------------------------------------------------------ wxMenu* MainEmuFrame::MakeStatesSubMenu(int baseid, int loadBackupId) const { @@ -154,6 +156,10 @@ bool MainEmuFrame::Destroy() // 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()) return;