浏览代码

Use ObjectDisposedException throw helper in UdpServerEntryPoint

Patrick Barron 1 年之前
父节点
当前提交
57a2267304
共有 1 个文件被更改,包括 1 次插入9 次删除
  1. 1 9
      Emby.Server.Implementations/EntryPoints/UdpServerEntryPoint.cs

+ 1 - 9
Emby.Server.Implementations/EntryPoints/UdpServerEntryPoint.cs

@@ -68,7 +68,7 @@ namespace Emby.Server.Implementations.EntryPoints
         /// <inheritdoc />
         /// <inheritdoc />
         public Task RunAsync()
         public Task RunAsync()
         {
         {
-            CheckDisposed();
+            ObjectDisposedException.ThrowIf(_disposed, this);
 
 
             if (!_configurationManager.GetNetworkConfiguration().AutoDiscovery)
             if (!_configurationManager.GetNetworkConfiguration().AutoDiscovery)
             {
             {
@@ -123,14 +123,6 @@ namespace Emby.Server.Implementations.EntryPoints
             return Task.CompletedTask;
             return Task.CompletedTask;
         }
         }
 
 
-        private void CheckDisposed()
-        {
-            if (_disposed)
-            {
-                throw new ObjectDisposedException(GetType().Name);
-            }
-        }
-
         /// <inheritdoc />
         /// <inheritdoc />
         public void Dispose()
         public void Dispose()
         {
         {