diff options
author | Muxi Yan <mxyan@google.com> | 2017-06-26 12:19:27 -0700 |
---|---|---|
committer | Muxi Yan <mxyan@google.com> | 2017-06-26 12:19:27 -0700 |
commit | 08fef09ed1b96f703b205fa98f5dd712ef3059e9 (patch) | |
tree | b7792bf86795983cf23c9858c8323f56e8374302 /src/objective-c | |
parent | 9ae2a7dc8653f1f9e7a83dfb249b4e93ea697a7c (diff) |
Fix minor problems
Diffstat (limited to 'src/objective-c')
-rw-r--r-- | src/objective-c/RxLibrary/GRXBufferedPipe.m | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/src/objective-c/RxLibrary/GRXBufferedPipe.m b/src/objective-c/RxLibrary/GRXBufferedPipe.m index b69305b41f..31c1448b55 100644 --- a/src/objective-c/RxLibrary/GRXBufferedPipe.m +++ b/src/objective-c/RxLibrary/GRXBufferedPipe.m @@ -96,13 +96,11 @@ switch (newState) { case GRXWriterStateFinished: + self.writeable = nil; if (_state == GRXWriterStatePaused) { - dispatch_resume(_writeQueue); + _writeQueue = nil; } _state = newState; - // Per GRXWriter's contract, setting the state to Finished manually means one doesn't wish the - // writeable to be messaged anymore. - _writeable = nil; return; case GRXWriterStatePaused: if (_state == GRXWriterStateStarted) { @@ -124,13 +122,12 @@ - (void)startWithWriteable:(id<GRXWriteable>)writeable { _state = GRXWriterStateStarted; - _writeable = writeable; + self.writeable = writeable; dispatch_resume(_writeQueue); } - (void)finishWithError:(NSError *)errorOrNil { id<GRXWriteable> writeable = self.writeable; - self.writeable = nil; self.state = GRXWriterStateFinished; dispatch_async(_writeQueue, ^{ [writeable writesFinishedWithError:errorOrNil]; |