This commit is contained in:
Xpl0itR 2019-09-19 19:40:35 +01:00 committed by unknown
commit 620367672a
No known key found for this signature in database
GPG key ID: 91798184109676AD

View file

@ -24,16 +24,20 @@ namespace Ryujinx.UI
private static IAalOutput _audioOut; private static IAalOutput _audioOut;
private static GlScreen _screen;
private static Application _gtkApplication; private static Application _gtkApplication;
private static ListStore _tableStore; private static ListStore _tableStore;
private static bool _gameLoaded = false; private static bool _gameLoaded = false;
private static string _userId = "00000000000000000000000000000001"; private static bool _ending = false;
private static bool _firstLoadComplete = false; private static bool _firstLoadComplete = false;
private static string _userId = "00000000000000000000000000000001";
private static TreeViewColumn favColumn; private static TreeViewColumn favColumn;
private static TreeViewColumn appColumn; private static TreeViewColumn appColumn;
private static TreeViewColumn devColumn; private static TreeViewColumn devColumn;
@ -392,9 +396,9 @@ namespace Ryujinx.UI
{ {
Configuration.ConfigureHid(_device, SwitchSettings.SwitchConfig); Configuration.ConfigureHid(_device, SwitchSettings.SwitchConfig);
using (GlScreen screen = new GlScreen(_device, _renderer)) using (_screen = new GlScreen(_device, _renderer))
{ {
screen.MainLoop(); _screen.MainLoop();
End(); End();
} }
@ -402,6 +406,10 @@ namespace Ryujinx.UI
private static void End() private static void End()
{ {
if (!_ending)
{
_ending = true;
if (_gameLoaded) if (_gameLoaded)
{ {
try try
@ -446,6 +454,7 @@ namespace Ryujinx.UI
Logger.Shutdown(); Logger.Shutdown();
Environment.Exit(0); Environment.Exit(0);
} }
}
/// <summary> /// <summary>
/// Picks an <see cref="IAalOutput"/> audio output renderer supported on this machine /// Picks an <see cref="IAalOutput"/> audio output renderer supported on this machine
@ -545,11 +554,13 @@ namespace Ryujinx.UI
private void Exit_Pressed(object o, EventArgs args) private void Exit_Pressed(object o, EventArgs args)
{ {
_screen?.Exit();
End(); End();
} }
private void Window_Close(object o, DeleteEventArgs args) private void Window_Close(object o, DeleteEventArgs args)
{ {
_screen?.Exit();
End(); End();
} }