From deb22ad0fe02820dcdfe6431793e7ee9ecdf1d75 Mon Sep 17 00:00:00 2001 From: Jack251970 <1160210343@qq.com> Date: Fri, 11 Apr 2025 22:05:04 +0800 Subject: [PATCH] Set CanClose earlier --- Flow.Launcher/MainWindow.xaml.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Flow.Launcher/MainWindow.xaml.cs b/Flow.Launcher/MainWindow.xaml.cs index 30afe67a1..bf7a45b1d 100644 --- a/Flow.Launcher/MainWindow.xaml.cs +++ b/Flow.Launcher/MainWindow.xaml.cs @@ -291,15 +291,15 @@ namespace Flow.Launcher { if (!CanClose) { + CanClose = true; _notifyIcon.Visible = false; App.API.SaveAppAllSettings(); e.Cancel = true; await ImageLoader.WaitSaveAsync(); await PluginManager.DisposePluginsAsync(); Notification.Uninstall(); - // After plugins are all disposed, we can close the main window - CanClose = true; - // Use this instead of Close() to avoid InvalidOperationException when calling Close() in OnClosing event + // After plugins are all disposed, we shutdown application to close app + // We use this instead of Close() to avoid InvalidOperationException when calling Close() in OnClosing event Application.Current.Shutdown(); } }