made the NSURLSessionDownloadTask pointer in download method __strong, maybe it will help stuff

This commit is contained in:
Elad Gil
2019-08-25 14:23:01 +03:00
parent ff6425271f
commit 67b34fd8d1

View File

@@ -121,7 +121,7 @@ RCT_EXPORT_METHOD(download: (NSDictionary *) options) {
}
}
NSURLSessionDownloadTask *task = [urlSession downloadTaskWithRequest:request];
NSURLSessionDownloadTask __strong *task = [urlSession downloadTaskWithRequest:request];
RNBGDTaskConfig *taskConfig = [[RNBGDTaskConfig alloc] initWithDictionary: @{@"id": identifier, @"destination": destination}];
@synchronized(taskToConfigMap) {
taskToConfigMap[@(task.taskIdentifier)] = taskConfig;