From 24265b03ac5c6ace73916f3bc3a847abf1c64c33 Mon Sep 17 00:00:00 2001 From: Muxi Yan Date: Tue, 6 Nov 2018 11:31:48 -0800 Subject: [PATCH] Clarify cancel before call is started --- src/objective-c/GRPCClient/GRPCCall.h | 1 + src/objective-c/GRPCClient/GRPCCall.m | 1 + 2 files changed, 2 insertions(+) diff --git a/src/objective-c/GRPCClient/GRPCCall.h b/src/objective-c/GRPCClient/GRPCCall.h index 4f0660d203e..f713262b643 100644 --- a/src/objective-c/GRPCClient/GRPCCall.h +++ b/src/objective-c/GRPCClient/GRPCCall.h @@ -245,6 +245,7 @@ extern NSString *const kGRPCTrailersKey; /** * Starts the call. This function should only be called once; additional calls will be discarded. + * Invokes after calling cancel: are discarded. */ - (void)start; diff --git a/src/objective-c/GRPCClient/GRPCCall.m b/src/objective-c/GRPCClient/GRPCCall.m index 9be0554ff98..5ce361300d6 100644 --- a/src/objective-c/GRPCClient/GRPCCall.m +++ b/src/objective-c/GRPCClient/GRPCCall.m @@ -209,6 +209,7 @@ const char *kCFStreamVarName = "grpc_cfstream"; - (void)cancel { dispatch_async(_dispatchQueue, ^{ + self->_started = YES; if (self->_call) { [self->_call cancel]; self->_call = nil;