Skip to content

Commit

Permalink
OLPHttpTask to lock toIgnoreResponse before usage (#1560)
Browse files Browse the repository at this point in the history
It is 'synchronized' in the didCompleteWithError callback so it's better
to add 'synchronized' in the restarting as well

Relates-To: DATASDK-45

Signed-off-by: Rustam Gamidov <ext-rustam.gamidov@here.com>
  • Loading branch information
rustam-gamidov-here authored Oct 24, 2024
1 parent 60f7ef8 commit e1ef3e7
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion olp-cpp-sdk-core/src/http/ios/OLPHttpTask.mm
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,9 @@ - (OLPHttpTaskStatus)restart {
}

if (_dataTask) {
_httpClient.toIgnoreResponse[_dataTask.taskDescription] = _dataTask;
@synchronized(_httpClient.toIgnoreResponse) {
_httpClient.toIgnoreResponse[_dataTask.taskDescription] = _dataTask;
}
[_dataTask cancel];
_dataTask = nil;
}
Expand Down

0 comments on commit e1ef3e7

Please sign in to comment.