You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
given CancellationTokenSource is disposable. is it a problem to not have it being disposed?
public static class TimeSpanExtensions
{
public static CancellationToken ToCancellationToken(this TimeSpan timeout)
{
var cts = new CancellationTokenSource(timeout);
return cts.Token;
}
}
You should be sure to call the CancellationTokenSource.Dispose method when you have finished using the cancellation token source to free any unmanaged resources it holds.