File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -659,22 +659,20 @@ - (void)closeWithCode:(NSInteger)code reason:(NSString *)reason;
659659
660660 [self _sendFrameWithOpcode: SROpCodeConnectionClose data: payload];
661661 });
662-
663- if (self.closeTimeout != nil ) {
664- __weak SRWebSocket const *weakSelf = self;
665- dispatch_after (
666- dispatch_time (DISPATCH_TIME_NOW, (int64_t )(self.closeTimeout .doubleValue * NSEC_PER_SEC)),
667- _workQueue,
668- ^{
669- SRWebSocket const *strongSelf = weakSelf;
670- if (strongSelf==nil ) {
671- return ;
672- }
673- if (strongSelf.readyState != SR_CLOSED) {
674- [strongSelf _disconnect ];
675- }
676- });
677- }
662+
663+ if (self.closeTimeout != nil ) {
664+ __weak SRWebSocket const *weakSelf = self;
665+ dispatch_after (
666+ dispatch_time (DISPATCH_TIME_NOW, (int64_t )(self.closeTimeout .doubleValue * NSEC_PER_SEC)),
667+ _workQueue,
668+ ^{
669+ SRWebSocket const *strongSelf = weakSelf;
670+ if (strongSelf != nil && strongSelf.readyState != SR_CLOSED) {
671+ [strongSelf _disconnect ];
672+ }
673+ }
674+ );
675+ }
678676}
679677
680678- (void )_closeWithProtocolError : (NSString *)message ;
You can’t perform that action at this time.
0 commit comments