Fixed SDWebImageOperation cancelling

GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.

Have a question about this project?Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub?Sign into your account

If you will set the same URL to 2 different UIImageViews, only one download operation is started(for the first one).

If the first one gets cancelled because of setting the new URL(possible with UICollectionView recycled views during scrolling),

second will never load any image and will never be notified about cancel.

Call UIImageViews progressBlock on main thread – otherwise you can get crash when UIKits objects deallocation will happen in background thread

Included Pull request1044(Fixes990)

Make SDWebImageCombinedOperation thread safe

Make SDWebImageCombinedOperation thread safe

Merge branch master of :timkoma/SDWebImage

Conflicts: SDWebImage/SDWebImageManager.m

y completedBlock with cancelled error Signed-off-by: Marek Timko marek.

cancelInternalAndStop race condition fix

Signed-off-by: Marek Timko marek.

Signed-off-by: Marek Timko marek.

dont call endBackgroundTask two times

Signed-off-by: Marek Timko marek.

Signed-off-by: Marek Timko marek.

Signed-off-by: Marek Timko marek.

Merge branch Fixes990 into SDWebImageOperation+Canceling

Conflicts: SDWebImage/SDWebImageManager.m

safe SDWebImageOperation canceling (not finished)

Signed-off-by: Marek Timko marek.

SDWebImageOperation canceling (continued, not working)

Signed-off-by: Marek Timko marek.

SDWebImageOperation canceling (continued, not working), UIView+WebCac

heOperations needs to be fixed Signed-off-by: Marek Timko marek.

Signed-off-by: Marek Timko marek.

dont return finished operation pointer from SDWebImageManager::downl

oadImageWithURL Signed-off-by: Marek Timko marek.

Signed-off-by: Marek Timko marek.

Merge branch master of m:rs/SDWebImage into SDWebImageOper

Fixes from UIImageView+WebCache.m copied into MKAnnotationView+WebCac

he.m, UIButton+WebCache.m and UIImageView+HighlightedWebCache.m Signed-off-by: Marek Timko marek.

Signed-off-by: Marek Timko marek.

Signed-off-by: Marek Timko marek.

Merge branch SDWebImageOperation+Canceling of github.com:timkoma/SD

WebImage into SDWebImageOperation+Canceling

Merge branch SDWebImageOperation+Canceling of github.com:timkoma/SD

WebImage into SDWebImageOperation+Canceling

Merge branch SDWebImageOperation+Canceling of github.com:timkoma/SD

WebImage into SDWebImageOperation+Canceling

@e is a problem with WebP. I do not know how to fix it:

– WARN [iOS] [SDWebImage/WebP] libwebp/src/utils/bit_writer.c:262:11: warning: code will never be executed [-Wunreachable-code]

– NOTE [iOS] [SDWebImage/WebP] libwebp/src/utils/bit_writer.c:261:29: note: silence by adding parentheses to mark code as explicitly dead

[!] SDWebImage did not pass validation.

–no-cleanoption to inspect any issue.The command pod lib lint exited with 1.

bit_writer.cfile generates a warning because of some unused code. Ive fixed Travis by adding the–allow-warningsflag topod spec lint. Please rebase on top of master

bpoplauschiadded this to the4.0.0milestone

timkomareferenced this pull request

sd_setImageWithURL calls completion block twice when used with SDWebImageRefreshCached

I had this crash on the call back for cancel() btw when I used this pull request in my fork. Try doing a sd_setImageWithURL nested within the completion block of another sd_setImageWithURL – both setting image on the same weakImageView.

timkomareferenced this pull request

[SDWebImageCombinedOperation setCancelBlock:]: message sent to deallocated instance

Sorry for the late response, Im busy right now, I will take a look at this next week.

Merge branch master of github.com:rs/SDWebImage into SDWebImageOper

User has to be notified about canceled download

Merge branch SDWebImageOperation+Canceling of github.com:timkoma/SD

WebImage into SDWebImageOperation+Canceling

Merge branch master of github.com:rs/SDWebImage into SDWebImageOper

Analyse and decide what we can import from forks

Fix multiple requests for same image and then canceling one

Whats the status of this request? Im seeing this issue quite a bit in my table views, and seems like a generally pretty important fix to incorporate.

What you could do, if you have some free time, is to cleanup all the commits here and rebase into a new pull request so we can retry it, as these changes here are not easily debugged/checked.

In the meantime, it would help me if you could do a merge from master into this branch, or at least review the one I did and pushed it to my fork:

bpoplauschireferenced this pull request

mageOperation+Canceling Conflicts: SDWebImage/SDWebImageDownloader.m SDWebImage/SDWebImageDownloaderOperation.m SDWebImage/SDWebImageManager.m SDWebImage/UIImageView+WebCache.m

mkoma/SDWebImageinto SDWebImageOperation+Canceling

bpoplauschimodified the milestones:3.7.4

After analysing this MR and883, I think the safer one is883, as1069had shown issues and failed to pass the tests from1222. your support and work here, but for now I will go with the other implementation. Hope I am making the right decision.

bpoplauschimodified the milestones:4.0.0

to join this conversation on GitHub

. Already have an account?Sign in to comment

You cant perform that action at this time.

You signed in with another tab or window.Reloadto refresh your session.

You signed out in another tab or window.Reloadto refresh your session.