Fix random exceptions when disposing DelayedThrottledTask

This commit is contained in:
chylex 2025-03-16 21:18:58 +01:00
parent e7c52fd1d5
commit 5741fad528
No known key found for this signature in database

View File

@ -55,7 +55,10 @@ public sealed class DelayedThrottledTask<T> : IDisposable {
}
public void Dispose() {
try {
cancellationTokenSource.Cancel();
} catch (ObjectDisposedException) {}
taskChannel.Writer.Complete();
cancellationTokenSource.Cancel();
}
}