diff options
Diffstat (limited to 'src/objective-c/GRPCClient')
-rw-r--r-- | src/objective-c/GRPCClient/GRPCCall.m | 5 | ||||
-rw-r--r-- | src/objective-c/GRPCClient/private/GRPCHost.m | 4 |
2 files changed, 8 insertions, 1 deletions
diff --git a/src/objective-c/GRPCClient/GRPCCall.m b/src/objective-c/GRPCClient/GRPCCall.m index 5b48d06158..9783b06440 100644 --- a/src/objective-c/GRPCClient/GRPCCall.m +++ b/src/objective-c/GRPCClient/GRPCCall.m @@ -206,8 +206,9 @@ static NSString *const kBearerPrefix = @"Bearer "; } else { [_responseWriteable enqueueSuccessfulCompletion]; } - +#ifndef GRPC_CFSTREAM [GRPCConnectivityMonitor unregisterObserver:self]; +#endif // If the call isn't retained anywhere else, it can be deallocated now. _retainSelf = nil; @@ -462,7 +463,9 @@ static NSString *const kBearerPrefix = @"Bearer "; [self sendHeaders:_requestHeaders]; [self invokeCall]; +#ifndef GRPC_CFSTREAM [GRPCConnectivityMonitor registerObserver:self selector:@selector(connectivityChanged:)]; +#endif } - (void)startWithWriteable:(id<GRXWriteable>)writeable { diff --git a/src/objective-c/GRPCClient/private/GRPCHost.m b/src/objective-c/GRPCClient/private/GRPCHost.m index bd5fd94118..ac448d0696 100644 --- a/src/objective-c/GRPCClient/private/GRPCHost.m +++ b/src/objective-c/GRPCClient/private/GRPCHost.m @@ -49,7 +49,9 @@ static NSMutableDictionary *kHostCache; if (_channelCreds != nil) { grpc_channel_credentials_release(_channelCreds); } +#ifndef GRPC_CFSTREAM [GRPCConnectivityMonitor unregisterObserver:self]; +#endif } // Default initializer. @@ -84,7 +86,9 @@ static NSMutableDictionary *kHostCache; kHostCache[address] = self; _compressAlgorithm = GRPC_COMPRESS_NONE; } +#ifndef GRPC_CFSTREAM [GRPCConnectivityMonitor registerObserver:self selector:@selector(connectivityChange:)]; +#endif } return self; } |