Make tests pass

pull/16190/head
Muxi Yan 6 years ago
parent 2bd38f29df
commit b5434c05aa
  1. 2
      src/objective-c/GRPCClient/GRPCCall.m
  2. 11
      src/objective-c/GRPCClient/private/GRPCChannel.m
  3. 1
      src/objective-c/GRPCClient/private/GRPCWrappedCall.m

@ -249,7 +249,7 @@ const char *kCFStreamVarName = "grpc_cfstream";
GRPCAssert(!self->_canceled, NSInternalInconsistencyException, @"Call arleady canceled.");
GRPCAssert(!self->_finished, NSInternalInconsistencyException,
@"Call is half-closed before sending data.");
if (self->_call) {
if (self->_pipe) {
[self->_pipe writeValue:data];
}
});

@ -281,15 +281,14 @@ static const NSTimeInterval kDefaultChannelDestroyDelay = 30;
// This function should be called on _dispatchQueue.
- (void)ref {
dispatch_sync(_dispatchQueue, ^{
self->_refcount++;
if (self->_refcount == 1 && self->_lastDispatch != nil) {
self->_lastDispatch = nil;
}
});
_refcount++;
if (_refcount == 1 && _lastDispatch != nil) {
_lastDispatch = nil;
}
}
- (void)unref {
NSLog(@"unref");
dispatch_async(_dispatchQueue, ^{
GRPCAssert(self->_refcount > 0, NSInternalInconsistencyException, @"Illegal reference count.");
self->_refcount--;

@ -325,7 +325,6 @@
- (void)dealloc {
if (_call) {
grpc_call_unref(_call);
[_channel unref];
}
[_channel unref];
_channel = nil;

Loading…
Cancel
Save