mirror of
https://github.com/JKorf/CryptoExchange.Net
synced 2025-07-23 18:05:43 +00:00
Fixed unhandled messages after unsubscribing
This commit is contained in:
parent
2720a03290
commit
93a64b2b1d
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user