diff --git a/OpenRA.Launcher/Program.cs b/OpenRA.Launcher/Program.cs index fd26346c8b..46d2e795ca 100644 --- a/OpenRA.Launcher/Program.cs +++ b/OpenRA.Launcher/Program.cs @@ -20,19 +20,22 @@ namespace OpenRA.Launcher [STAThread] static int Main(string[] args) { - if (Debugger.IsAttached || args.Contains("--just-die")) - return (int)Game.InitializeAndRun(args); - - AppDomain.CurrentDomain.UnhandledException += (_, e) => ExceptionHandler.HandleFatalError((Exception)e.ExceptionObject); - try { - return (int)Game.InitializeAndRun(args); - } - catch (Exception e) - { - ExceptionHandler.HandleFatalError(e); - return (int)RunStatus.Error; + if (Debugger.IsAttached || args.Contains("--just-die")) + return (int)Game.InitializeAndRun(args); + + AppDomain.CurrentDomain.UnhandledException += (_, e) => ExceptionHandler.HandleFatalError((Exception)e.ExceptionObject); + + try + { + return (int)Game.InitializeAndRun(args); + } + catch (Exception e) + { + ExceptionHandler.HandleFatalError(e); + return (int)RunStatus.Error; + } } finally { diff --git a/OpenRA.WindowsLauncher/Program.cs b/OpenRA.WindowsLauncher/Program.cs index ae1a98a144..f593733d9b 100644 --- a/OpenRA.WindowsLauncher/Program.cs +++ b/OpenRA.WindowsLauncher/Program.cs @@ -78,6 +78,10 @@ namespace OpenRA.WindowsLauncher ExceptionHandler.HandleFatalError(e); return (int)RunStatus.Error; } + finally + { + Log.Dispose(); + } } static int RunInnerLauncher(string[] args)