react-native/Libraries/WebSocket
zhongwuzw dd209bb789 Fix crash for web socket in some race conditions (#22439)
Summary:
Fixes #21086.
Fixes #6117.

This PR fixes a crash caused by a race condition when `webSocket` deallocated and `NSStream` delegate callback, because `NSStream`'s delegate callback be called on `RCTSR_networkRunLoop`.

This PR mainly changes:

* Remove unnecessary `nil` operation in `dealloc` method.
* Add a new method `_scheduleCleanUp` to schedule `webSocket` cleanup also on `RCTSR_networkRunLoop`.
* In `stream:(NSStream *)aStream handleEvent:(NSStreamEvent)eventCode` delegate method, add a `wself` to make safe further.
Pull Request resolved: https://github.com/facebook/react-native/pull/22439

Differential Revision: D13564247

Pulled By: cpojer

fbshipit-source-id: 675c1b2805aa45c54d7708d796f5843ef7ea34e2
2019-01-01 17:55:29 -08:00
..
RCTWebSocket.xcodeproj Ensure HelloWorld xcodeproj template works 2018-10-18 01:06:25 -07:00
__mocks__ Update copyright headers to yearless format 2018-09-11 15:33:07 -07:00
__tests__ Remove some automocks from tests 2018-09-18 04:18:11 -07:00
RCTReconnectingWebSocket.h Update copyright headers to yearless format 2018-09-11 15:33:07 -07:00
RCTReconnectingWebSocket.m Update copyright headers to yearless format 2018-09-11 15:33:07 -07:00
RCTSRWebSocket.h Backed out changeset 183744d2415b 2016-03-15 11:49:28 -07:00
RCTSRWebSocket.m Fix crash for web socket in some race conditions (#22439) 2019-01-01 17:55:29 -08:00
RCTWebSocketExecutor.h Update copyright headers to yearless format 2018-09-11 15:33:07 -07:00
RCTWebSocketExecutor.m Update copyright headers to yearless format 2018-09-11 15:33:07 -07:00
RCTWebSocketModule.h Update copyright headers to yearless format 2018-09-11 15:33:07 -07:00
RCTWebSocketModule.m Update copyright headers to yearless format 2018-09-11 15:33:07 -07:00
WebSocket.js Use `invariant` instead of `fbjs/lib/invariant` 2018-12-03 00:07:02 -08:00
WebSocketEvent.js Update copyright headers to yearless format 2018-09-11 15:33:07 -07:00
WebSocketInterceptor.js Update copyright headers to yearless format 2018-09-11 15:33:07 -07:00