You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix: avoid race condition crash in [RCTDataRequestHandler invalidate] (#2383)
## Summary:
Upstreaming a fix by @ntre that fixes a crash we saw internally related
to `[_queue cancelAllOperations]`.
>Calling [_queue cancelAllOperations] will release all references to any
active operations.
>If the blocks of those operations have a reference to itself, it will
result in dangling pointers, which could conceptually trigger a later
crash if there's a race between the operation completing and it being
pulled out of the queue.
>
>Add explicit strong reference while block is running.
>For good measure, fix same pattern also in RCTFileRequestHandler.
>
>Note: separately, that this code is passing the op itself as a
requestToken to [delegate URLRequest:] methods is suspect. That delegate
can retain said token.
## Test Plan:
Tested internally.
0 commit comments