From ee1307474df402231b677738cf28dc693dd17c06 Mon Sep 17 00:00:00 2001 From: Gil Date: Sun, 13 May 2018 21:02:46 -0700 Subject: Clean up implicit retain self warnings introduced recently (#1268) --- Firestore/Source/Core/FSTFirestoreClient.mm | 29 +++++++++++++------------- Firestore/Source/Util/FSTAsyncQueryListener.mm | 2 +- 2 files changed, 16 insertions(+), 15 deletions(-) (limited to 'Firestore/Source') diff --git a/Firestore/Source/Core/FSTFirestoreClient.mm b/Firestore/Source/Core/FSTFirestoreClient.mm index 93d1f7c..cede958 100644 --- a/Firestore/Source/Core/FSTFirestoreClient.mm +++ b/Firestore/Source/Core/FSTFirestoreClient.mm @@ -239,7 +239,7 @@ NS_ASSUME_NONNULL_BEGIN [self.workerDispatchQueue dispatchAsync:^{ [self.remoteStore disableNetwork]; if (completion) { - _userExecutor->Execute([=] { completion(nil); }); + self->_userExecutor->Execute([=] { completion(nil); }); } }]; } @@ -248,7 +248,7 @@ NS_ASSUME_NONNULL_BEGIN [self.workerDispatchQueue dispatchAsync:^{ [self.remoteStore enableNetwork]; if (completion) { - _userExecutor->Execute([=] { completion(nil); }); + self->_userExecutor->Execute([=] { completion(nil); }); } }]; } @@ -260,7 +260,7 @@ NS_ASSUME_NONNULL_BEGIN [self.remoteStore shutdown]; [self.persistence shutdown]; if (completion) { - _userExecutor->Execute([=] { completion(nil); }); + self->_userExecutor->Execute([=] { completion(nil); }); } }]; } @@ -341,14 +341,14 @@ NS_ASSUME_NONNULL_BEGIN [self.workerDispatchQueue dispatchAsync:^{ if (mutations.count == 0) { if (completion) { - _userExecutor->Execute([=] { completion(nil); }); + self->_userExecutor->Execute([=] { completion(nil); }); } } else { [self.syncEngine writeMutations:mutations completion:^(NSError *error) { // Dispatch the result back onto the user dispatch queue. if (completion) { - _userExecutor->Execute([=] { completion(error); }); + self->_userExecutor->Execute([=] { completion(error); }); } }]; } @@ -359,15 +359,16 @@ NS_ASSUME_NONNULL_BEGIN updateBlock:(FSTTransactionBlock)updateBlock completion:(FSTVoidIDErrorBlock)completion { [self.workerDispatchQueue dispatchAsync:^{ - [self.syncEngine transactionWithRetries:retries - workerDispatchQueue:self.workerDispatchQueue - updateBlock:updateBlock - completion:^(id _Nullable result, NSError *_Nullable error) { - // Dispatch the result back onto the user dispatch queue. - if (completion) { - _userExecutor->Execute([=] { completion(result, error); }); - } - }]; + [self.syncEngine + transactionWithRetries:retries + workerDispatchQueue:self.workerDispatchQueue + updateBlock:updateBlock + completion:^(id _Nullable result, NSError *_Nullable error) { + // Dispatch the result back onto the user dispatch queue. + if (completion) { + self->_userExecutor->Execute([=] { completion(result, error); }); + } + }]; }]; } diff --git a/Firestore/Source/Util/FSTAsyncQueryListener.mm b/Firestore/Source/Util/FSTAsyncQueryListener.mm index 426594b..81dd41f 100644 --- a/Firestore/Source/Util/FSTAsyncQueryListener.mm +++ b/Firestore/Source/Util/FSTAsyncQueryListener.mm @@ -42,7 +42,7 @@ using firebase::firestore::util::internal::Executor; // users just want to turn on notifications "forever" and don't want to have // to keep track of our handle to keep them going. return ^(FSTViewSnapshot *_Nullable snapshot, NSError *_Nullable error) { - _executor->Execute([self, snapshot, error] { + self->_executor->Execute([self, snapshot, error] { if (!self->_muted) { self->_snapshotHandler(snapshot, error); } -- cgit v1.2.3