From fe91772f18dada23d9f1b28d3816a30d0f21448b Mon Sep 17 00:00:00 2001 From: LukePulverenti Date: Mon, 11 Mar 2013 12:54:52 -0400 Subject: [PATCH] fixed semaphore dispose issue --- .../Net/BasePeriodicWebSocketListener.cs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/MediaBrowser.Common/Net/BasePeriodicWebSocketListener.cs b/MediaBrowser.Common/Net/BasePeriodicWebSocketListener.cs index 9207ffe1d..aedb0c05e 100644 --- a/MediaBrowser.Common/Net/BasePeriodicWebSocketListener.cs +++ b/MediaBrowser.Common/Net/BasePeriodicWebSocketListener.cs @@ -146,6 +146,12 @@ namespace MediaBrowser.Common.Net Data = data }, tuple.Item2.Token).ConfigureAwait(false); + + tuple.Item5.Release(); + } + catch (ObjectDisposedException) + { + // Socket has already been disposed } catch (OperationCanceledException) { @@ -159,10 +165,6 @@ namespace MediaBrowser.Common.Net Logger.ErrorException("Error sending web socket message {0}", ex, Name); DisposeConnection(tuple); } - finally - { - tuple.Item5.Release(); - } } ///