mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-12-20 15:55:25 +03:00
Don't dispose managed CancellationTokenSource (#6139)
This commit is contained in:
@@ -11,7 +11,7 @@ namespace Jellyfin.Api.Models.PlaybackDtos
|
||||
/// <summary>
|
||||
/// Class TranscodingJob.
|
||||
/// </summary>
|
||||
public class TranscodingJobDto
|
||||
public class TranscodingJobDto : IDisposable
|
||||
{
|
||||
/// <summary>
|
||||
/// The process lock.
|
||||
@@ -249,5 +249,31 @@ namespace Jellyfin.Api.Models.PlaybackDtos
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public void Dispose()
|
||||
{
|
||||
Dispose(true);
|
||||
GC.SuppressFinalize(this);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Dispose all resources.
|
||||
/// </summary>
|
||||
/// <param name="disposing">Whether to dispose all resources.</param>
|
||||
protected virtual void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing)
|
||||
{
|
||||
Process?.Dispose();
|
||||
Process = null;
|
||||
KillTimer?.Dispose();
|
||||
KillTimer = null;
|
||||
CancellationTokenSource?.Dispose();
|
||||
CancellationTokenSource = null;
|
||||
TranscodingThrottler?.Dispose();
|
||||
TranscodingThrottler = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user