Skip to content

Commit bf259dc

Browse files
committed
Fix application dispose issue
1 parent cc1e6dd commit bf259dc

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

Flow.Launcher/App.xaml.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,11 @@ private async void OnStartup(object sender, StartupEventArgs e)
138138
{
139139
await Stopwatch.NormalAsync("|App.OnStartup|Startup cost", async () =>
140140
{
141+
// Because new message box api uses MessageBoxEx window,
142+
// if it is created and closed before main window is created, it will cause the application to exit.
143+
// So set to OnExplicitShutdown to prevent the application from shutting down before main window is created
144+
Current.ShutdownMode = ShutdownMode.OnExplicitShutdown;
145+
141146
Log.SetLogLevel(_settings.LogLevel);
142147

143148
Ioc.Default.GetRequiredService<Portable>().PreStartCleanUpAfterPortabilityUpdate();

0 commit comments

Comments
 (0)