properly dispose the filestream

This commit is contained in:
Hongtao Zhang 2025-01-10 13:11:35 -06:00
parent a62b222e6b
commit 4b38e0e714

View file

@ -190,7 +190,7 @@ namespace Flow.Launcher.Infrastructure.Storage
public async Task SaveAsync()
{
var tempOutput = File.OpenWrite(TempFilePath);
await using var tempOutput = File.OpenWrite(TempFilePath);
await JsonSerializer.SerializeAsync(tempOutput, Data,
new JsonSerializerOptions { WriteIndented = true });
AtomicWriteSetting();