File tree Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -381,17 +381,18 @@ - (void)closeWithFinalState:(FSTStreamState)finalState error:(nullable NSError *
381
381
_messageReceived = NO ;
382
382
_rpc = nil ;
383
383
384
- // Clear the delegates to avoid any possible bleed through of events from GRPC.
385
384
FSTAssert (_delegate,
386
385
@" closeWithFinalState should only be called for a started stream that has an active "
387
386
@" delegate." );
388
- _delegate = nil ;
389
387
390
388
// If the caller explicitly requested a stream stop, don't notify them of a closing stream (it
391
389
// could trigger undesirable recovery logic, etc.).
392
390
if (finalState != FSTStreamStateStopped) {
393
391
[self notifyStreamInterruptedWithError: error];
394
392
}
393
+
394
+ // Clear the delegates to avoid any possible bleed through of events from GRPC.
395
+ _delegate = nil ;
395
396
}
396
397
397
398
- (void )stop {
@@ -615,7 +616,9 @@ - (void)notifyStreamOpen {
615
616
}
616
617
617
618
- (void )notifyStreamInterruptedWithError : (nullable NSError *)error {
618
- [self .delegate watchStreamWasInterruptedWithError: error];
619
+ id <FSTWatchStreamDelegate> delegate = self.delegate ;
620
+ self.delegate = nil ;
621
+ [delegate watchStreamWasInterruptedWithError: error];
619
622
}
620
623
621
624
- (void )watchQuery : (FSTQueryData *)query {
@@ -701,7 +704,9 @@ - (void)notifyStreamOpen {
701
704
}
702
705
703
706
- (void )notifyStreamInterruptedWithError : (nullable NSError *)error {
704
- [self .delegate writeStreamWasInterruptedWithError: error];
707
+ id <FSTWriteStreamDelegate> delegate = self.delegate ;
708
+ self.delegate = nil ;
709
+ [delegate writeStreamWasInterruptedWithError: error];
705
710
}
706
711
707
712
- (void )tearDown {
You can’t perform that action at this time.
0 commit comments