Avoid submitting blocks to a nil dispatch queue. (#26113)

reviewable/pr26131/r1
yulin liang 4 years ago committed by GitHub
parent 45bceae7a5
commit 266d0f7c05
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 12
      src/objective-c/GRPCClient/GRPCCallLegacy.m

@ -271,10 +271,14 @@ static NSString *const kBearerPrefix = @"Bearer ";
}
- (void)dealloc {
__block GRPCWrappedCall *wrappedCall = _wrappedCall;
dispatch_async(_callQueue, ^{
wrappedCall = nil;
});
if (_callQueue) {
__block GRPCWrappedCall *wrappedCall = _wrappedCall;
dispatch_async(_callQueue, ^{
wrappedCall = nil;
});
} else {
_wrappedCall = nil;
}
}
#pragma mark Read messages

Loading…
Cancel
Save