MZDownloadManager icon indicating copy to clipboard operation
MZDownloadManager copied to clipboard

Having issues when downloading over fast network on slow devices

Open christie-alphero opened this issue 6 years ago • 2 comments

In the MZDownload.swift in the " func urlSession(_ session: URLSession, downloadTask: URLSessionDownloadTask, didWriteData bytesWritten: Int64, totalBytesWritten: Int64, totalBytesExpectedToWrite: Int64)"

I am getting a bunch of crashes. It is always an index out of bounds exception on Line 210.

It seems as though while the download model is being updated asynchrounously, the download array is updated and the downloadingArray no longer contains the download model at the index specified.

christie-alphero avatar Jul 26 '18 02:07 christie-alphero

I've looked into it a bit more, and adding the check just causes weird behaviour (although with no crashes). Pulling the inner logic out of the async block seems to fix the issue. Is there a reason that the inner logic is wrapped in a async block?

christie-alphero avatar Jul 27 '18 02:07 christie-alphero

I am getting below kind of error:

Object 0x2821a1a40 deallocated with retain count 2, reference mav have escaped from deinit. 2023-05-22 13:52:43.944428+0530 Pilgrim_app_jos[64500:11735455] Object 0x2821a1a40 deallocated with retain count 2, reference mav have escaped from deinit

@christie-alphero Do you have Any idea why its happening?

YogeshBhattGWL avatar May 22 '23 08:05 YogeshBhattGWL