Skip to content

Commit deb22ad

Browse files
committed
Set CanClose earlier
1 parent 526f002 commit deb22ad

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Flow.Launcher/MainWindow.xaml.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -291,15 +291,15 @@ private async void OnClosing(object sender, CancelEventArgs e)
291291
{
292292
if (!CanClose)
293293
{
294+
CanClose = true;
294295
_notifyIcon.Visible = false;
295296
App.API.SaveAppAllSettings();
296297
e.Cancel = true;
297298
await ImageLoader.WaitSaveAsync();
298299
await PluginManager.DisposePluginsAsync();
299300
Notification.Uninstall();
300-
// After plugins are all disposed, we can close the main window
301-
CanClose = true;
302-
// Use this instead of Close() to avoid InvalidOperationException when calling Close() in OnClosing event
301+
// After plugins are all disposed, we shutdown application to close app
302+
// We use this instead of Close() to avoid InvalidOperationException when calling Close() in OnClosing event
303303
Application.Current.Shutdown();
304304
}
305305
}

0 commit comments

Comments
 (0)