From bca3939a65743944e2cd339207447b72efbbc42f Mon Sep 17 00:00:00 2001 From: svc64 Date: Wed, 13 Dec 2023 19:34:44 +0200 Subject: [PATCH] Kill the message handler thread when killing the debugger --- src/Ryujinx.HLE/Debugger/Debugger.cs | 6 +++++- src/Ryujinx.HLE/Debugger/Message/KillMessage.cs | 6 ++++++ 2 files changed, 11 insertions(+), 1 deletion(-) create mode 100644 src/Ryujinx.HLE/Debugger/Message/KillMessage.cs diff --git a/src/Ryujinx.HLE/Debugger/Debugger.cs b/src/Ryujinx.HLE/Debugger/Debugger.cs index 4a4979a9c3..840faf6192 100644 --- a/src/Ryujinx.HLE/Debugger/Debugger.cs +++ b/src/Ryujinx.HLE/Debugger/Debugger.cs @@ -167,6 +167,9 @@ namespace Ryujinx.HLE.Debugger DebugProcess.DebugStop(); Reply($"T05thread:{ctx.ThreadUid:x};"); break; + + case KillMessage: + return; } } } @@ -732,8 +735,9 @@ namespace Ryujinx.HLE.Debugger ReadStream?.Close(); WriteStream?.Close(); DebuggerThread.Join(); - Messages.Dispose(); + Messages.Add(new KillMessage()); MessageHandlerThread.Join(); + Messages.Dispose(); } } diff --git a/src/Ryujinx.HLE/Debugger/Message/KillMessage.cs b/src/Ryujinx.HLE/Debugger/Message/KillMessage.cs new file mode 100644 index 0000000000..43ae0f21e7 --- /dev/null +++ b/src/Ryujinx.HLE/Debugger/Message/KillMessage.cs @@ -0,0 +1,6 @@ +namespace Ryujinx.HLE.Debugger +{ + struct KillMessage : IMessage + { + } +}