From 8506b7a3342692a2c92322df727b675738a09829 Mon Sep 17 00:00:00 2001 From: Mary Date: Sat, 10 Oct 2020 00:52:11 +0200 Subject: [PATCH] Fix exiting emulator with multi programs (#1590) THis fix a bug introduced in #1560 that would cause "Stop emulation" to actually restart the game all the time. --- Ryujinx.HLE/HOS/UserChannelPersistence.cs | 2 ++ Ryujinx/Ui/MainWindow.cs | 5 +++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/Ryujinx.HLE/HOS/UserChannelPersistence.cs b/Ryujinx.HLE/HOS/UserChannelPersistence.cs index 13e7364f0..4b041ce88 100644 --- a/Ryujinx.HLE/HOS/UserChannelPersistence.cs +++ b/Ryujinx.HLE/HOS/UserChannelPersistence.cs @@ -10,6 +10,7 @@ namespace Ryujinx.HLE.HOS public int PreviousIndex { get; private set; } public int Index { get; private set; } public ProgramSpecifyKind Kind { get; private set; } + public bool ShouldRestart { get; set; } public UserChannelPersistence() { @@ -42,6 +43,7 @@ namespace Ryujinx.HLE.HOS { Kind = kind; PreviousIndex = Index; + ShouldRestart = true; switch (kind) { diff --git a/Ryujinx/Ui/MainWindow.cs b/Ryujinx/Ui/MainWindow.cs index 4cfcd4891..dafb5a451 100644 --- a/Ryujinx/Ui/MainWindow.cs +++ b/Ryujinx/Ui/MainWindow.cs @@ -975,9 +975,10 @@ namespace Ryujinx.Ui private void HandleRelaunch() { - // If the previous index isn't -1, that mean we are relaunching. - if (_userChannelPersistence.PreviousIndex != -1) + if (_userChannelPersistence.PreviousIndex != -1 && _userChannelPersistence.ShouldRestart) { + _userChannelPersistence.ShouldRestart = false; + LoadApplication(_gamePath); } else