mirror of
https://github.com/bloxstraplabs/bloxstrap.git
synced 2025-04-19 00:51:30 -07:00
Add soft termination for settings window
This commit is contained in:
parent
81c6512055
commit
fe04b468b0
@ -66,6 +66,15 @@ namespace Bloxstrap
|
||||
Environment.Exit(exitCodeNum);
|
||||
}
|
||||
|
||||
public static void SoftTerminate(ErrorCode exitCode = ErrorCode.ERROR_SUCCESS)
|
||||
{
|
||||
int exitCodeNum = (int)exitCode;
|
||||
|
||||
Logger.WriteLine("App::SoftTerminate", $"Terminating with exit code {exitCodeNum} ({exitCode})");
|
||||
|
||||
Current.Dispatcher.Invoke(() => Current.Shutdown(exitCodeNum));
|
||||
}
|
||||
|
||||
void GlobalExceptionHandler(object sender, DispatcherUnhandledExceptionEventArgs e)
|
||||
{
|
||||
e.Handled = true;
|
||||
|
@ -102,7 +102,7 @@ namespace Bloxstrap.UI.Elements.Settings
|
||||
App.State.Save();
|
||||
|
||||
if (!e.Cancel)
|
||||
App.Terminate();
|
||||
App.SoftTerminate();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user