aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMary <me@thog.eu>2020-10-10 00:52:11 +0200
committerGitHub <noreply@github.com>2020-10-10 00:52:11 +0200
commit8506b7a3342692a2c92322df727b675738a09829 (patch)
tree746ce292386bf23f39f22f4255c95e0416c1c31a
parent0954e76a261235107b2255c33de595d188570274 (diff)
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.
-rw-r--r--Ryujinx.HLE/HOS/UserChannelPersistence.cs2
-rw-r--r--Ryujinx/Ui/MainWindow.cs5
2 files changed, 5 insertions, 2 deletions
diff --git a/Ryujinx.HLE/HOS/UserChannelPersistence.cs b/Ryujinx.HLE/HOS/UserChannelPersistence.cs
index 13e7364f..4b041ce8 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 4cfcd489..dafb5a45 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