Merge pull request #15429 from grpc/fix-conc-self

Fix self use in GRXConcurrentWriteable
pull/15559/head
Muxi Yan 7 years ago committed by GitHub
commit 4d6644ada8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 6
      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;
}
}
});

Loading…
Cancel
Save