From 9afb8ad485b364e3ecf738b1175c32cce95507bd Mon Sep 17 00:00:00 2001 From: Thomas Guillemard Date: Sun, 8 Sep 2019 03:59:41 +0200 Subject: [PATCH] ui: Fix segfault on Linux when passing a program via command line (#764) --- Ryujinx/Program.cs | 5 +++++ Ryujinx/Ui/MainWindow.cs | 4 +--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/Ryujinx/Program.cs b/Ryujinx/Program.cs index 5663a5d5..94cbd80d 100644 --- a/Ryujinx/Program.cs +++ b/Ryujinx/Program.cs @@ -30,6 +30,11 @@ namespace Ryujinx gtkApplication.AddWindow(mainWindow); mainWindow.Show(); + if (args.Length == 1) + { + mainWindow.LoadApplication(args[0]); + } + Application.Run(); } diff --git a/Ryujinx/Ui/MainWindow.cs b/Ryujinx/Ui/MainWindow.cs index 8a38f7c1..59ce5092 100644 --- a/Ryujinx/Ui/MainWindow.cs +++ b/Ryujinx/Ui/MainWindow.cs @@ -131,8 +131,6 @@ namespace Ryujinx.UI UpdateGameTable(); // Temporary code section end - - LoadApplication(args[0]); } else { @@ -202,7 +200,7 @@ namespace Ryujinx.UI StyleContext.AddProviderForScreen(Gdk.Screen.Default, cssProvider, 800); } - private void LoadApplication(string path) + internal void LoadApplication(string path) { if (_gameLoaded) {