From 9589d1c3a8fa904a38f119f9280a496c75bb17e8 Mon Sep 17 00:00:00 2001 From: Levi Dumas Date: Tue, 12 Mar 2024 18:54:59 -0500 Subject: [PATCH] Made execution neater --- src/Ryujinx/AppHost.cs | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/Ryujinx/AppHost.cs b/src/Ryujinx/AppHost.cs index 84d302e14..ce9dd1d7e 100644 --- a/src/Ryujinx/AppHost.cs +++ b/src/Ryujinx/AppHost.cs @@ -736,6 +736,14 @@ namespace Ryujinx.Ava Logger.Info?.Print(LogClass.Emulation, "Emulation was paused"); } + internal void Close() + { + if (Application.Current.ApplicationLifetime is IClassicDesktopStyleApplicationLifetime app) + { + app.MainWindow.Close(); + } + } + private void InitializeSwitchInstance() { // Initialize KeySet. @@ -1006,10 +1014,7 @@ namespace Ryujinx.Ava { if (ConfigurationState.Instance.CloseOnEmulatorStop) { - if (Application.Current.ApplicationLifetime is IClassicDesktopStyleApplicationLifetime app) - { - app.MainWindow.Close(); - } + Close(); } else {