aboutsummaryrefslogtreecommitdiffstats
path: root/src/slskd
diff options
context:
space:
mode:
authorJP Dillingham <jp@dillingham.me>2026-11-14 18:38:56 -0600
committerGitHub <noreply@github.com>2026-11-14 18:38:56 -0600
commita9a12166305b846538b4e5076e1f01daf6070d49 (patch)
treed0f05c9aab9a7f56bdaec97b5788b5b43efb0238 /src/slskd
parent1f4754f40005af6e1110bd00c7a7705a7203287a (diff)
parent34cc2546e3dae7d402e2c017f69e05756914ce2d (diff)
downloadslskd-a9a12166305b846538b4e5076e1f01daf6070d49.tar.gz
Merge pull request #1923 from slskd/object-disposed
Ensure cancellation tokens are disposed when a download fails
Diffstat (limited to 'src/slskd')
-rw-r--r--src/slskd/Transfers/Downloads/DownloadService.cs5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/slskd/Transfers/Downloads/DownloadService.cs b/src/slskd/Transfers/Downloads/DownloadService.cs
index 43a9d17c..32744fb2 100644
--- a/src/slskd/Transfers/Downloads/DownloadService.cs
+++ b/src/slskd/Transfers/Downloads/DownloadService.cs
@@ -1100,6 +1100,11 @@ namespace slskd.Transfers.Downloads
Log.Error(ex, "Failed to update database: {Message}", ex.Message);
return false;
}
+ finally
+ {
+ CancellationTokens.TryRemove(id, out var cts);
+ cts?.TryDispose();
+ }
}
/// <summary>