Alamofire / AlamofireImage

AlamofireImage is an image component library for Alamofire
MIT License
3.99k stars 523 forks source link

Fix image download request should be really cancelled #368

Closed kinarobin closed 5 years ago

kinarobin commented 5 years ago

Goals :soccer:

When I cancel task with image download receipt, I found the network is still downloaded the data. So once the task had been canceled, the network shouldn't download the image data anymore.

If each image is not cancelled correctly, it will cause the network downloaded the data that is related to users, If the image data is so large, that will cause a memory pressure.

Implementation Details :construction:

Even if the request is currently executing , it should be cancelled!

cnoon commented 5 years ago

Hi @kinarobin,

Apologies for taking so long to get to this. I've incorporated these changes into #371 and #372 and shipped them in AFI 4.0.0-beta.4. Please let us know if you run into any further issues.

Thanks! 🍻