Skip to content
This repository has been archived by the owner on Mar 16, 2019. It is now read-only.

Add thread safety protection for taskTable write operation #668

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion ios/RNFetchBlobNetwork.m
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,10 @@ - (void) sendRequest:(__weak NSDictionary * _Nullable )options
}

__block NSURLSessionDataTask * task = [session dataTaskWithRequest:req];
[taskTable setObject:task forKey:taskId];
@synchronized(taskTable)
{
[taskTable setObject:task forKey:taskId];
}
[task resume];

// network status indicator
Expand Down