diff options
| author | Patrick Barron <barronpm@gmail.com> | 2023-11-30 12:20:17 -0500 |
|---|---|---|
| committer | Patrick Barron <barronpm@gmail.com> | 2023-11-30 12:21:49 -0500 |
| commit | 612edaed7a69ced778ce6006421c7ffa994b4787 (patch) | |
| tree | 070234aa8dd3377dd2d46a09cc6913893130a32c | |
| parent | a37bd4e6592edaaad20bb3b225ab9fcd4e40f6f1 (diff) | |
Fix disposable analyzer issues in ExternalPortForwarding
| -rw-r--r-- | Emby.Server.Implementations/EntryPoints/ExternalPortForwarding.cs | 15 |
1 files changed, 3 insertions, 12 deletions
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 /// <summary> /// Server entrypoint handling external port forwarding. /// </summary> - public class ExternalPortForwarding : IServerEntryPoint + public sealed class ExternalPortForwarding : IServerEntryPoint { private readonly IServerApplicationHost _appHost; private readonly ILogger<ExternalPortForwarding> _logger; @@ -32,7 +32,7 @@ namespace Emby.Server.Implementations.EntryPoints private Timer _timer; private string _configIdentifier; - private bool _disposed = false; + private bool _disposed; /// <summary> /// Initializes a new instance of the <see cref="ExternalPortForwarding"/> class. @@ -178,16 +178,6 @@ namespace Emby.Server.Implementations.EntryPoints /// <inheritdoc /> public void Dispose() { - Dispose(true); - GC.SuppressFinalize(this); - } - - /// <summary> - /// Releases unmanaged and - optionally - managed resources. - /// </summary> - /// <param name="dispose"><c>true</c> to release both managed and unmanaged resources; <c>false</c> to release only unmanaged resources.</param> - protected virtual void Dispose(bool dispose) - { if (_disposed) { return; @@ -197,6 +187,7 @@ namespace Emby.Server.Implementations.EntryPoints Stop(); + _timer?.Dispose(); _timer = null; _disposed = true; |
