Skip to content
Merged
Prev Previous commit
Next Next commit
fix more const& v.s. dispatch bug zxu123 committed
  • Loading branch information
zxu123 committed Feb 16, 2018
commit 5cb11cae69f226900502faa8023a42e8a3f003dd
5 changes: 3 additions & 2 deletions Firestore/Source/Remote/FSTDatastore.mm
Original file line number Diff line number Diff line change
Expand Up @@ -304,6 +304,7 @@ - (void)invokeRPCWithFactory:(GRPCProtoCall * (^)(void))rpcFactory
[self.credentials
getTokenForcingRefresh:NO
completion:^(const Token &result, NSError *_Nullable error) {
const Token resultCopy = result;
error = [FSTDatastore firestoreErrorForError:error];
[self.workerDispatchQueue dispatchAsyncAllowingSameQueue:^{
if (error) {
Expand All @@ -313,8 +314,8 @@ - (void)invokeRPCWithFactory:(GRPCProtoCall * (^)(void))rpcFactory
[FSTDatastore
prepareHeadersForRPC:rpc
databaseID:&self.databaseInfo->database_id()
token:(result.is_valid() ? result.token()
: absl::string_view())];
token:(resultCopy.is_valid() ? resultCopy.token()
: absl::string_view())];
[rpc start];
}
}];
Expand Down