|
@@ -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;
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
}
|