Fix application dispose issue

This commit is contained in:
Jack251970 2025-04-01 08:47:57 +08:00
parent cc1e6dd7ee
commit bf259dcb13

View file

@ -138,6 +138,11 @@ namespace Flow.Launcher
{
await Stopwatch.NormalAsync("|App.OnStartup|Startup cost", async () =>
{
// Because new message box api uses MessageBoxEx window,
// if it is created and closed before main window is created, it will cause the application to exit.
// So set to OnExplicitShutdown to prevent the application from shutting down before main window is created
Current.ShutdownMode = ShutdownMode.OnExplicitShutdown;
Log.SetLogLevel(_settings.LogLevel);
Ioc.Default.GetRequiredService<Portable>().PreStartCleanUpAfterPortabilityUpdate();