diff --git a/Emby.Server.Implementations/EntryPoints/ExternalPortForwarding.cs b/Emby.Server.Implementations/EntryPoints/ExternalPortForwarding.cs index 7de184745..b3f172d5d 100644 --- a/Emby.Server.Implementations/EntryPoints/ExternalPortForwarding.cs +++ b/Emby.Server.Implementations/EntryPoints/ExternalPortForwarding.cs @@ -21,7 +21,7 @@ namespace Emby.Server.Implementations.EntryPoints /// /// Server entrypoint handling external port forwarding. /// - public class ExternalPortForwarding : IServerEntryPoint + public sealed class ExternalPortForwarding : IServerEntryPoint { private readonly IServerApplicationHost _appHost; private readonly ILogger _logger; @@ -32,7 +32,7 @@ namespace Emby.Server.Implementations.EntryPoints private Timer _timer; private string _configIdentifier; - private bool _disposed = false; + private bool _disposed; /// /// Initializes a new instance of the class. @@ -177,16 +177,6 @@ namespace Emby.Server.Implementations.EntryPoints /// public void Dispose() - { - Dispose(true); - GC.SuppressFinalize(this); - } - - /// - /// Releases unmanaged and - optionally - managed resources. - /// - /// true to release both managed and unmanaged resources; false to release only unmanaged resources. - protected virtual void Dispose(bool dispose) { if (_disposed) { @@ -197,6 +187,7 @@ namespace Emby.Server.Implementations.EntryPoints Stop(); + _timer?.Dispose(); _timer = null; _disposed = true;