Skip to content

Commit e1ef3e7

Browse files
OLPHttpTask to lock toIgnoreResponse before usage (#1560)
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 <[email protected]>
1 parent 60f7ef8 commit e1ef3e7

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

olp-cpp-sdk-core/src/http/ios/OLPHttpTask.mm

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,9 @@ - (OLPHttpTaskStatus)restart {
9898
}
9999

100100
if (_dataTask) {
101-
_httpClient.toIgnoreResponse[_dataTask.taskDescription] = _dataTask;
101+
@synchronized(_httpClient.toIgnoreResponse) {
102+
_httpClient.toIgnoreResponse[_dataTask.taskDescription] = _dataTask;
103+
}
102104
[_dataTask cancel];
103105
_dataTask = nil;
104106
}

0 commit comments

Comments
 (0)