diff options
author | Muxi Yan <mxyan@google.com> | 2018-12-07 16:12:00 -0800 |
---|---|---|
committer | Muxi Yan <mxyan@google.com> | 2018-12-07 16:12:00 -0800 |
commit | 3f00d61b04874cc5f0159c16f2c598a8f2fb93a7 (patch) | |
tree | 584fd1143911811e142109528bd56dc04702c8fc /src/objective-c/ProtoRPC/ProtoRPC.m | |
parent | df21aab3a6af360cff29a5164f9728ba646d35ab (diff) |
batch fix
Diffstat (limited to 'src/objective-c/ProtoRPC/ProtoRPC.m')
-rw-r--r-- | src/objective-c/ProtoRPC/ProtoRPC.m | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/src/objective-c/ProtoRPC/ProtoRPC.m b/src/objective-c/ProtoRPC/ProtoRPC.m index 15b0f681ce..abf224c3cf 100644 --- a/src/objective-c/ProtoRPC/ProtoRPC.m +++ b/src/objective-c/ProtoRPC/ProtoRPC.m @@ -140,7 +140,11 @@ static NSError *ErrorForBadProto(id proto, Class expectedClass, NSError *parsing } - (void)start { - [_call start]; + GRPCCall2 *copiedCall; + @synchronized(self) { + copiedCall = _call; + } + [copiedCall start]; } - (void)cancel { @@ -177,20 +181,20 @@ static NSError *ErrorForBadProto(id proto, Class expectedClass, NSError *parsing return; } - GRPCCall2 *call; + GRPCCall2 *copiedCall; @synchronized(self) { - call = _call; + copiedCall = _call; } - [call writeData:[message data]]; + [copiedCall writeData:[message data]]; } - (void)finish { - GRPCCall2 *call; + GRPCCall2 *copiedCall; @synchronized(self) { - call = _call; + copiedCall = _call; _call = nil; } - [call finish]; + [copiedCall finish]; } - (void)didReceiveInitialMetadata:(NSDictionary *)initialMetadata { |