mirror of
https://github.com/JKorf/CryptoExchange.Net.git
synced 2026-08-11 16:32:57 +00:00
Fixed unhandled messages after unsubscribing
This commit is contained in:
@@ -424,14 +424,13 @@ namespace CryptoExchange.Net.Sockets
|
||||
|
||||
var shouldCloseWrapper = false;
|
||||
lock (handlersLock)
|
||||
{
|
||||
handlers.Remove(subscription);
|
||||
if (handlers.Count(r => r.UserSubscription) == 0)
|
||||
shouldCloseWrapper = true;
|
||||
}
|
||||
shouldCloseWrapper = handlers.Count(r => r.UserSubscription && subscription != r) == 0;
|
||||
|
||||
if (shouldCloseWrapper)
|
||||
await Close().ConfigureAwait(false);
|
||||
|
||||
lock (handlersLock)
|
||||
handlers.Remove(subscription);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user