diff options
| author | Cody Robibero <cody@robibe.ro> | 2021-06-04 06:36:58 -0600 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-06-04 14:36:58 +0200 |
| commit | 9154f20b3404fb818b8c2e74af038547d2c16c40 (patch) | |
| tree | 207f80cdc19da9918185c424d57a2272a65cfa09 /Jellyfin.Api/Models | |
| parent | b060d9d0f1b3dac523288a3aaf182f7e35cf875c (diff) | |
Don't dispose managed CancellationTokenSource (#6139)
Diffstat (limited to 'Jellyfin.Api/Models')
| -rw-r--r-- | Jellyfin.Api/Models/PlaybackDtos/TranscodingJobDto.cs | 28 |
1 files changed, 27 insertions, 1 deletions
diff --git a/Jellyfin.Api/Models/PlaybackDtos/TranscodingJobDto.cs b/Jellyfin.Api/Models/PlaybackDtos/TranscodingJobDto.cs index 9edc19bb6..291e571dc 100644 --- a/Jellyfin.Api/Models/PlaybackDtos/TranscodingJobDto.cs +++ b/Jellyfin.Api/Models/PlaybackDtos/TranscodingJobDto.cs @@ -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; + } + } } } |
