0
0
Fork 0

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.
This commit is contained in:
Mary 2020-10-10 00:52:11 +02:00 committed by GitHub
parent 0954e76a26
commit 8506b7a334
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 2 deletions

View file

@ -10,6 +10,7 @@ namespace Ryujinx.HLE.HOS
public int PreviousIndex { get; private set; } public int PreviousIndex { get; private set; }
public int Index { get; private set; } public int Index { get; private set; }
public ProgramSpecifyKind Kind { get; private set; } public ProgramSpecifyKind Kind { get; private set; }
public bool ShouldRestart { get; set; }
public UserChannelPersistence() public UserChannelPersistence()
{ {
@ -42,6 +43,7 @@ namespace Ryujinx.HLE.HOS
{ {
Kind = kind; Kind = kind;
PreviousIndex = Index; PreviousIndex = Index;
ShouldRestart = true;
switch (kind) switch (kind)
{ {

View file

@ -975,9 +975,10 @@ namespace Ryujinx.Ui
private void HandleRelaunch() private void HandleRelaunch()
{ {
// If the previous index isn't -1, that mean we are relaunching. if (_userChannelPersistence.PreviousIndex != -1 && _userChannelPersistence.ShouldRestart)
if (_userChannelPersistence.PreviousIndex != -1)
{ {
_userChannelPersistence.ShouldRestart = false;
LoadApplication(_gamePath); LoadApplication(_gamePath);
} }
else else