mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-02-24 04:00:02 +01:00
update
This commit is contained in:
@@ -252,11 +252,6 @@ namespace PowerDisplay.Helpers
|
||||
// Release save permission even on error
|
||||
Interlocked.Exchange(ref _isSaving, 0);
|
||||
}
|
||||
catch
|
||||
{
|
||||
// Ensure we never crash on save
|
||||
Interlocked.Exchange(ref _isSaving, 0);
|
||||
}
|
||||
|
||||
await Task.CompletedTask; // Suppress async warning
|
||||
}
|
||||
|
||||
@@ -21,10 +21,6 @@
|
||||
<ProjectPriFileName>PowerToys.PowerDisplay.pri</ProjectPriFileName>
|
||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||
<Nullable>enable</Nullable>
|
||||
<!-- Disable StyleCop for this project -->
|
||||
<DisableStyleCop>true</DisableStyleCop>
|
||||
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
|
||||
<RunCodeAnalysis>false</RunCodeAnalysis>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Page Remove="PowerDisplayXAML\App.xaml" />
|
||||
|
||||
@@ -692,10 +692,13 @@ public class MainViewModel : INotifyPropertyChanged, IDisposable
|
||||
try
|
||||
{
|
||||
// Use Task.Run to avoid deadlock and wait with timeout
|
||||
var flushTask = Task.Run(async () => await _settingsManager?.FlushAsync());
|
||||
if (!flushTask.Wait(TimeSpan.FromSeconds(2)))
|
||||
if (_settingsManager != null)
|
||||
{
|
||||
Logger.LogWarning("Settings flush timed out during dispose");
|
||||
var flushTask = Task.Run(async () => await _settingsManager.FlushAsync());
|
||||
if (!flushTask.Wait(TimeSpan.FromSeconds(2)))
|
||||
{
|
||||
Logger.LogWarning("Settings flush timed out during dispose");
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
|
||||
Reference in New Issue
Block a user