From b43c3336ac2b47dd862068a7c1b4242b68e0f2f0 Mon Sep 17 00:00:00 2001 From: Muxi Yan Date: Thu, 17 May 2018 10:47:57 -0700 Subject: [PATCH] Fix self use in GRXConcurrentWriteable --- src/objective-c/RxLibrary/GRXConcurrentWriteable.m | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/objective-c/RxLibrary/GRXConcurrentWriteable.m b/src/objective-c/RxLibrary/GRXConcurrentWriteable.m index 523c59c6de7..81ccc3fbcea 100644 --- a/src/objective-c/RxLibrary/GRXConcurrentWriteable.m +++ b/src/objective-c/RxLibrary/GRXConcurrentWriteable.m @@ -68,7 +68,7 @@ typeof(self) strongSelf = weakSelf; if (strongSelf) { BOOL finished = NO; - @synchronized(self) { + @synchronized(strongSelf) { if (!strongSelf->_alreadyFinished) { strongSelf->_alreadyFinished = YES; } else { @@ -78,9 +78,9 @@ if (!finished) { // Cancellation is now impossible. None of the other three blocks can run concurrently with // this one. - [self.writeable writesFinishedWithError:nil]; + [strongSelf.writeable writesFinishedWithError:nil]; // Skip any possible message to the wrapped writeable enqueued after this one. - self.writeable = nil; + strongSelf.writeable = nil; } } });