aboutsummaryrefslogtreecommitdiff
path: root/Emby.Server.Implementations/Channels
diff options
context:
space:
mode:
authorCody Robibero <cody@robibe.ro>2022-02-16 20:47:22 -0700
committerGitHub <noreply@github.com>2022-02-16 20:47:22 -0700
commit9930efec2208cb1756eff3eb181044d6f6f3e3da (patch)
treee3cd0ffe83f6202e949b864ba815e45bcd859ab7 /Emby.Server.Implementations/Channels
parent5825a0572bdcd11afad283f1e62c07f5e2c61c06 (diff)
parent5732e6188c78e9e0de4a5557bfa9cfa64e05b506 (diff)
Merge pull request #7321 from Bond-009/warn61
Diffstat (limited to 'Emby.Server.Implementations/Channels')
-rw-r--r--Emby.Server.Implementations/Channels/ChannelManager.cs29
-rw-r--r--Emby.Server.Implementations/Channels/RefreshChannelsScheduledTask.cs2
2 files changed, 29 insertions, 2 deletions
diff --git a/Emby.Server.Implementations/Channels/ChannelManager.cs b/Emby.Server.Implementations/Channels/ChannelManager.cs
index a107e7a52..09429c73f 100644
--- a/Emby.Server.Implementations/Channels/ChannelManager.cs
+++ b/Emby.Server.Implementations/Channels/ChannelManager.cs
@@ -39,7 +39,7 @@ namespace Emby.Server.Implementations.Channels
/// <summary>
/// The LiveTV channel manager.
/// </summary>
- public class ChannelManager : IChannelManager
+ public class ChannelManager : IChannelManager, IDisposable
{
private readonly IUserManager _userManager;
private readonly IUserDataManager _userDataManager;
@@ -52,6 +52,7 @@ namespace Emby.Server.Implementations.Channels
private readonly IMemoryCache _memoryCache;
private readonly SemaphoreSlim _resourcePool = new SemaphoreSlim(1, 1);
private readonly JsonSerializerOptions _jsonOptions = JsonDefaults.Options;
+ private bool _disposed = false;
/// <summary>
/// Initializes a new instance of the <see cref="ChannelManager"/> class.
@@ -1213,5 +1214,31 @@ namespace Emby.Server.Implementations.Channels
return result;
}
+
+ /// <inheritdoc />
+ public void Dispose()
+ {
+ Dispose(true);
+ GC.SuppressFinalize(this);
+ }
+
+ /// <summary>
+ /// Releases unmanaged and optionally managed resources.
+ /// </summary>
+ /// <param name="disposing"><c>true</c> to release both managed and unmanaged resources; <c>false</c> to release only unmanaged resources.</param>
+ protected virtual void Dispose(bool disposing)
+ {
+ if (_disposed)
+ {
+ return;
+ }
+
+ if (disposing)
+ {
+ _resourcePool?.Dispose();
+ }
+
+ _disposed = true;
+ }
}
}
diff --git a/Emby.Server.Implementations/Channels/RefreshChannelsScheduledTask.cs b/Emby.Server.Implementations/Channels/RefreshChannelsScheduledTask.cs
index e5dde48d8..cfd08e653 100644
--- a/Emby.Server.Implementations/Channels/RefreshChannelsScheduledTask.cs
+++ b/Emby.Server.Implementations/Channels/RefreshChannelsScheduledTask.cs
@@ -62,7 +62,7 @@ namespace Emby.Server.Implementations.Channels
public string Key => "RefreshInternetChannels";
/// <inheritdoc />
- public async Task Execute(CancellationToken cancellationToken, IProgress<double> progress)
+ public async Task ExecuteAsync(IProgress<double> progress, CancellationToken cancellationToken)
{
var manager = (ChannelManager)_channelManager;