diff --git a/Libraries/Network/RCTNetworking.mm b/Libraries/Network/RCTNetworking.mm index f8de23abf..e7e5ad88c 100644 --- a/Libraries/Network/RCTNetworking.mm +++ b/Libraries/Network/RCTNetworking.mm @@ -139,6 +139,11 @@ RCT_EXPORT_MODULE() - (void)invalidate { + for (NSNumber *requestID in _tasksByRequestID) { + [_tasksByRequestID[requestID] cancel]; + } + [_tasksByRequestID removeAllObjects]; + _handlers = nil; _requestHandlers = nil; _responseHandlers = nil; }