Skip to content

Commit

Permalink
Dispose filestream before deleting
Browse files Browse the repository at this point in the history
  • Loading branch information
ScrubN committed Jun 24, 2024
1 parent 085070b commit ac2ecf5
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions TwitchDownloaderCore/ChatDownloader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,7 @@ public async Task DownloadAsync(CancellationToken cancellationToken)
{
try
{
await outputFs.DisposeAsync();
outputFileInfo.Delete();
}
catch { }
Expand Down
2 changes: 2 additions & 0 deletions TwitchDownloaderCore/ChatRenderer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ public async Task RenderVideoAsync(CancellationToken cancellationToken)
{
try
{
await outputFs.DisposeAsync();
outputFileInfo.Delete();
}
catch { }
Expand All @@ -104,6 +105,7 @@ public async Task RenderVideoAsync(CancellationToken cancellationToken)
{
try
{
await maskFs.DisposeAsync();
maskFileInfo.Delete();
}
catch { }
Expand Down
1 change: 1 addition & 0 deletions TwitchDownloaderCore/ChatUpdater.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ public async Task UpdateAsync(CancellationToken cancellationToken)
{
try
{
await outputFs.DisposeAsync();
outputFileInfo.Delete();
}
catch { }
Expand Down
1 change: 1 addition & 0 deletions TwitchDownloaderCore/ClipDownloader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ public async Task DownloadAsync(CancellationToken cancellationToken)
{
try
{
await outputFs.DisposeAsync();
outputFileInfo.Delete();
}
catch { }
Expand Down
1 change: 1 addition & 0 deletions TwitchDownloaderCore/TsMerger.cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ public async Task MergeAsync(CancellationToken cancellationToken)
{
try
{
await outputFs.DisposeAsync();
outputFileInfo.Delete();
}
catch { }
Expand Down
1 change: 1 addition & 0 deletions TwitchDownloaderCore/VideoDownloader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ public async Task DownloadAsync(CancellationToken cancellationToken)
{
try
{
await outputFs.DisposeAsync();
outputFileInfo.Delete();
}
catch { }
Expand Down

0 comments on commit ac2ecf5

Please sign in to comment.