Skip to content

Commit e558a0b

Browse files
Merge
2 parents 27107a7 + 65834fc commit e558a0b

40 files changed

+2254
-2110
lines changed

src/Files.App/App.xaml.cs

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
using CommunityToolkit.WinUI;
33
using CommunityToolkit.WinUI.Helpers;
44
using CommunityToolkit.WinUI.Notifications;
5-
using Files.App.Controllers;
65
using Files.App.DataModels;
76
using Files.App.Extensions;
87
using Files.App.Filesystem;
@@ -30,6 +29,7 @@
3029
using Microsoft.Extensions.DependencyInjection;
3130
using Microsoft.UI.Windowing;
3231
using Microsoft.UI.Xaml;
32+
using Microsoft.UI.Xaml.Controls;
3333
using Microsoft.Windows.AppLifecycle;
3434
using System;
3535
using System.Diagnostics;
@@ -54,6 +54,7 @@ public partial class App : Application
5454
private static bool ShowErrorNotification = false;
5555

5656
public static string OutputPath { get; set; }
57+
public static CommandBarFlyout? LastOpenedFlyout { get; set; }
5758
public static StorageHistoryWrapper HistoryWrapper = new StorageHistoryWrapper();
5859
public static SettingsViewModel AppSettings { get; private set; }
5960
public static AppModel AppModel { get; private set; }
@@ -287,6 +288,15 @@ private async void Window_Closed(object sender, WindowEventArgs args)
287288
{
288289
// Save application state and stop any background activity
289290

291+
// A Workaround for the crash (#10110)
292+
if (LastOpenedFlyout?.IsOpen ?? false)
293+
{
294+
args.Handled = true;
295+
LastOpenedFlyout.Closed += (sender, e) => App.Current.Exit();
296+
LastOpenedFlyout.Hide();
297+
return;
298+
}
299+
290300
await Task.Yield(); // Method can take a long time, make sure the window is hidden
291301

292302
SaveSessionTabs();
Binary file not shown.

0 commit comments

Comments
 (0)