Use different method to get NSData bytes

This commit is contained in:
Tobias Taschner
2018-11-12 14:14:11 +01:00
parent 152e160f76
commit d477aade96

View File

@@ -173,11 +173,9 @@ wxWebResponseURLSession::~wxWebResponseURLSession()
void wxWebResponseURLSession::HandleData(WX_NSData data) void wxWebResponseURLSession::HandleData(WX_NSData data)
{ {
[data enumerateByteRangesUsingBlock:^(const void * _Nonnull bytes, NSRange byteRange, BOOL * _Nonnull stop) { void* buf = GetDataBuffer(data.length);
void* buf = GetDataBuffer(byteRange.length); [data getBytes:buf length:data.length];
std::memcpy(buf, bytes, byteRange.length); ReportDataReceived(data.length);
ReportDataReceived(byteRange.length);
}];
} }
wxInt64 wxWebResponseURLSession::GetContentLength() const wxInt64 wxWebResponseURLSession::GetContentLength() const