|
|
@@ -32,6 +32,8 @@ namespace Ryujinx.Ui
|
|
|
|
|
|
private static GlScreen _screen;
|
|
|
|
|
|
+ private static AutoResetEvent _screenExitStatus = new AutoResetEvent(false);
|
|
|
+
|
|
|
private static ListStore _tableStore;
|
|
|
|
|
|
private static bool _updatingGameTable;
|
|
|
@@ -278,7 +280,7 @@ namespace Ryujinx.Ui
|
|
|
{
|
|
|
if (_gameLoaded)
|
|
|
{
|
|
|
- GtkDialog.CreateErrorDialog("A game has already been loaded. Please close the emulator and try again");
|
|
|
+ GtkDialog.CreateDialog("Ryujinx", "A game has already been loaded", "Please close it first and try again.");
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
@@ -347,6 +349,8 @@ namespace Ryujinx.Ui
|
|
|
|
|
|
_emulationContext = device;
|
|
|
|
|
|
+ _screenExitStatus.Reset();
|
|
|
+
|
|
|
#if MACOS_BUILD
|
|
|
CreateGameWindow(device);
|
|
|
#else
|
|
|
@@ -393,6 +397,8 @@ namespace Ryujinx.Ui
|
|
|
|
|
|
DiscordIntegrationModule.SwitchToMainMenu();
|
|
|
|
|
|
+ _screenExitStatus.Set();
|
|
|
+
|
|
|
Application.Invoke(delegate
|
|
|
{
|
|
|
_stopEmulation.Sensitive = false;
|
|
|
@@ -432,12 +438,17 @@ namespace Ryujinx.Ui
|
|
|
if (device != null)
|
|
|
{
|
|
|
UpdateGameMetadata(device.System.TitleIdText);
|
|
|
+
|
|
|
+ if (_screen != null)
|
|
|
+ {
|
|
|
+ _screen.Exit();
|
|
|
+ _screenExitStatus.WaitOne();
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
Dispose();
|
|
|
|
|
|
Profile.FinishProfiling();
|
|
|
- device?.Dispose();
|
|
|
DiscordIntegrationModule.Exit();
|
|
|
Logger.Shutdown();
|
|
|
Application.Quit();
|
|
|
@@ -584,13 +595,11 @@ namespace Ryujinx.Ui
|
|
|
|
|
|
private void Exit_Pressed(object sender, EventArgs args)
|
|
|
{
|
|
|
- _screen?.Exit();
|
|
|
End(_emulationContext);
|
|
|
}
|
|
|
|
|
|
private void Window_Close(object sender, DeleteEventArgs args)
|
|
|
{
|
|
|
- _screen?.Exit();
|
|
|
End(_emulationContext);
|
|
|
}
|
|
|
|