Fix log should be disposed correctly
This commit is contained in:
@@ -20,19 +20,22 @@ namespace OpenRA.Launcher
|
|||||||
[STAThread]
|
[STAThread]
|
||||||
static int Main(string[] args)
|
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
|
try
|
||||||
{
|
{
|
||||||
return (int)Game.InitializeAndRun(args);
|
if (Debugger.IsAttached || args.Contains("--just-die"))
|
||||||
}
|
return (int)Game.InitializeAndRun(args);
|
||||||
catch (Exception e)
|
|
||||||
{
|
AppDomain.CurrentDomain.UnhandledException += (_, e) => ExceptionHandler.HandleFatalError((Exception)e.ExceptionObject);
|
||||||
ExceptionHandler.HandleFatalError(e);
|
|
||||||
return (int)RunStatus.Error;
|
try
|
||||||
|
{
|
||||||
|
return (int)Game.InitializeAndRun(args);
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
ExceptionHandler.HandleFatalError(e);
|
||||||
|
return (int)RunStatus.Error;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
finally
|
finally
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -78,6 +78,10 @@ namespace OpenRA.WindowsLauncher
|
|||||||
ExceptionHandler.HandleFatalError(e);
|
ExceptionHandler.HandleFatalError(e);
|
||||||
return (int)RunStatus.Error;
|
return (int)RunStatus.Error;
|
||||||
}
|
}
|
||||||
|
finally
|
||||||
|
{
|
||||||
|
Log.Dispose();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static int RunInnerLauncher(string[] args)
|
static int RunInnerLauncher(string[] args)
|
||||||
|
|||||||
Reference in New Issue
Block a user