diff --git a/src/Ryujinx.HLE/Debugger/Debugger.cs b/src/Ryujinx.HLE/Debugger/Debugger.cs index 9fbdc2175b..d065d4aaa8 100644 --- a/src/Ryujinx.HLE/Debugger/Debugger.cs +++ b/src/Ryujinx.HLE/Debugger/Debugger.cs @@ -26,6 +26,7 @@ namespace Ryujinx.HLE.Debugger private BlockingCollection Messages = new BlockingCollection(1); private Thread SocketThread; private Thread HandlerThread; + private bool _shuttingDown = false; private ulong? cThread; private ulong? gThread; @@ -633,7 +634,10 @@ namespace Ryujinx.HLE.Debugger { Logger.Error?.Print(LogClass.GdbStub, ex.ToString()); Logger.Notice.Print(LogClass.GdbStub, "GDB stub socket closed"); - return; + if (!_shuttingDown) + { + goto restartListen; + } } } @@ -689,6 +693,8 @@ namespace Ryujinx.HLE.Debugger { if (disposing) { + _shuttingDown = true; + if (HandlerThread.IsAlive) { Messages.Add(new AbortMessage());