diff options
author | Muxi Yan <mxyan@google.com> | 2018-10-18 12:11:29 -0700 |
---|---|---|
committer | Muxi Yan <mxyan@google.com> | 2018-10-18 12:14:25 -0700 |
commit | a0f83554bbe47d9d99d6e3146a8ec7ba3a129b63 (patch) | |
tree | b42224e36b537a0e742d7a12c74d2330870a6571 /src/objective-c/GRPCClient/private/GRPCChannelPool.m | |
parent | 3bdf794bd031162913f533a2a9535f4066a41abd (diff) |
remove channel from pool with pointer rather than config
Diffstat (limited to 'src/objective-c/GRPCClient/private/GRPCChannelPool.m')
-rw-r--r-- | src/objective-c/GRPCClient/private/GRPCChannelPool.m | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/objective-c/GRPCClient/private/GRPCChannelPool.m b/src/objective-c/GRPCClient/private/GRPCChannelPool.m index bfc624eb4e..b5b3ff60ef 100644 --- a/src/objective-c/GRPCClient/private/GRPCChannelPool.m +++ b/src/objective-c/GRPCClient/private/GRPCChannelPool.m @@ -199,9 +199,13 @@ extern const char *kCFStreamVarName; return channel; } -- (void)removeChannelWithConfiguration:(GRPCChannelConfiguration *)configuration { +- (void)removeChannel:(GRPCChannel *)channel { @synchronized(self) { - [self->_channelPool removeObjectForKey:configuration]; + [_channelPool enumerateKeysAndObjectsUsingBlock:^(GRPCChannelConfiguration * _Nonnull key, GRPCChannel * _Nonnull obj, BOOL * _Nonnull stop) { + if (obj == channel) { + [self->_channelPool removeObjectForKey:key]; + } + }]; } } |