Fix self use in GRXConcurrentWriteable

pull/15429/head
Muxi Yan 7 years ago committed by GitHub
parent 3fd27cea76
commit b43c3336ac
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