From 5ab04aa00b5e8d191e36700facaddb83110385f1 Mon Sep 17 00:00:00 2001 From: Souryo Date: Thu, 5 Oct 2017 21:40:25 -0400 Subject: [PATCH] Debugger: Close all debugger windows when emulation is stopped (prevents crashes) --- Core/Console.cpp | 1 + Core/INotificationListener.h | 2 +- GUI.NET/Forms/frmMain.cs | 6 ++++++ GUI.NET/InteropEmu.cs | 1 + 4 files changed, 9 insertions(+), 1 deletion(-) diff --git a/Core/Console.cpp b/Core/Console.cpp index c51a1171..707267c3 100644 --- a/Core/Console.cpp +++ b/Core/Console.cpp @@ -488,6 +488,7 @@ void Console::Run() _runLock.Release(); MessageManager::SendNotification(ConsoleNotificationType::GameStopped); + MessageManager::SendNotification(ConsoleNotificationType::EmulationStopped); } bool Console::IsRunning() diff --git a/Core/INotificationListener.h b/Core/INotificationListener.h index 6bf05f87..089ea37a 100644 --- a/Core/INotificationListener.h +++ b/Core/INotificationListener.h @@ -20,8 +20,8 @@ enum class ConsoleNotificationType ConfigChanged = 14, DisconnectedFromServer = 15, PpuViewerDisplayFrame = 16, - ExecuteShortcut = 17, + EmulationStopped = 18, }; class INotificationListener diff --git a/GUI.NET/Forms/frmMain.cs b/GUI.NET/Forms/frmMain.cs index 4a741b32..87068347 100644 --- a/GUI.NET/Forms/frmMain.cs +++ b/GUI.NET/Forms/frmMain.cs @@ -473,6 +473,12 @@ namespace Mesen.GUI.Forms })); break; + case InteropEmu.ConsoleNotificationType.EmulationStopped: + this.Invoke((Action)(() => { + DebugWindowManager.CloseAll(); + })); + break; + case InteropEmu.ConsoleNotificationType.ResolutionChanged: this.BeginInvoke((MethodInvoker)(() => { UpdateViewerSize(); diff --git a/GUI.NET/InteropEmu.cs b/GUI.NET/InteropEmu.cs index 346be678..35eb2251 100644 --- a/GUI.NET/InteropEmu.cs +++ b/GUI.NET/InteropEmu.cs @@ -800,6 +800,7 @@ namespace Mesen.GUI DisconnectedFromServer = 15, PpuViewerDisplayFrame = 16, ExecuteShortcut = 17, + EmulationStopped = 18, } public enum ControllerType