diff options
| author | Patrick Barron <barronpm@gmail.com> | 2021-03-14 10:19:35 -0400 |
|---|---|---|
| committer | Patrick Barron <barronpm@gmail.com> | 2021-03-14 10:19:35 -0400 |
| commit | e5380c653b0584a3b5d61da1a9b005d6155694cb (patch) | |
| tree | 328459396c783e8c61214c8d960d8ba07b5773f6 /RSSDP/SsdpDeviceLocator.cs | |
| parent | 7c413a323b0d22a59532687b854ea228d544ecb7 (diff) | |
| parent | 109f24514fac52c8f138c4913d7ef614ff1973a1 (diff) | |
Merge branch 'master' into ef-cleanup
# Conflicts:
# Jellyfin.Data/Entities/Libraries/MediaFileStream.cs
# Jellyfin.Data/Jellyfin.Data.csproj
Diffstat (limited to 'RSSDP/SsdpDeviceLocator.cs')
| -rw-r--r-- | RSSDP/SsdpDeviceLocator.cs | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/RSSDP/SsdpDeviceLocator.cs b/RSSDP/SsdpDeviceLocator.cs index bfad6de97..0cdc5ce3d 100644 --- a/RSSDP/SsdpDeviceLocator.cs +++ b/RSSDP/SsdpDeviceLocator.cs @@ -97,6 +97,11 @@ namespace Rssdp.Infrastructure private async void OnBroadcastTimerCallback(object state) { + if (IsDisposed) + { + return; + } + StartListeningForNotifications(); RemoveExpiredDevicesFromCache(); @@ -180,8 +185,6 @@ namespace Rssdp.Infrastructure /// <exception cref="ObjectDisposedException">Throw if the <see cref="DisposableManagedObjectBase.IsDisposed"/> ty is true.</exception> public void StartListeningForNotifications() { - ThrowIfDisposed(); - _CommunicationsServer.RequestReceived -= CommsServer_RequestReceived; _CommunicationsServer.RequestReceived += CommsServer_RequestReceived; _CommunicationsServer.BeginListeningForBroadcasts(); @@ -353,7 +356,7 @@ namespace Rssdp.Infrastructure { return; } - + var location = GetFirstHeaderUriValue("Location", message); if (location != null) { @@ -515,11 +518,6 @@ namespace Rssdp.Infrastructure private void RemoveExpiredDevicesFromCache() { - if (this.IsDisposed) - { - return; - } - DiscoveredSsdpDevice[] expiredDevices = null; lock (_Devices) { |
