mirror of
				https://github.com/JKorf/CryptoExchange.Net
				synced 2025-10-27 16:37:24 +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