Skip to content

Commit 8468d43

Browse files
authoredJun 9, 2018
Merge pull request #502 from photomadic/fix/upload-job-retained
fix(upload): prevent memory leaks from retained jobs
2 parents 9b130ad + 7dbe488 commit 8468d43

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed
 

‎RNFSManager.m

+2
Original file line numberDiff line numberDiff line change
@@ -559,6 +559,7 @@ + (BOOL)requiresMainQueueSetup
559559
params.method = method;
560560

561561
params.completeCallback = ^(NSString* body, NSURLResponse *resp) {
562+
[self.uploaders removeObjectForKey:[jobId stringValue]];
562563

563564
NSMutableDictionary* result = [[NSMutableDictionary alloc] initWithDictionary: @{@"jobId": jobId,
564565
@"body": body}];
@@ -570,6 +571,7 @@ + (BOOL)requiresMainQueueSetup
570571
};
571572

572573
params.errorCallback = ^(NSError* error) {
574+
[self.uploaders removeObjectForKey:[jobId stringValue]];
573575
return [self reject:reject withError:error];
574576
};
575577

0 commit comments

Comments
 (0)
Please sign in to comment.