From 54a772ebb93a74eb782e88eb71d1c0e301603101 Mon Sep 17 00:00:00 2001 From: "eric@skrobs" Date: Fri, 12 Sep 2014 20:03:34 +0200 Subject: [PATCH] Update UIImageView+WebCache.m Can cause animation losing or crash if you are in a thread. --- SDWebImage/UIImageView+WebCache.m | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/SDWebImage/UIImageView+WebCache.m b/SDWebImage/UIImageView+WebCache.m index 51663dd4..1e225eb0 100644 --- a/SDWebImage/UIImageView+WebCache.m +++ b/SDWebImage/UIImageView+WebCache.m @@ -43,7 +43,9 @@ static char imageURLKey; objc_setAssociatedObject(self, &imageURLKey, url, OBJC_ASSOCIATION_RETAIN_NONATOMIC); if (!(options & SDWebImageDelayPlaceholder)) { - self.image = placeholder; + dispatch_main_async_safe(^{ + self.image = placeholder; + }); } if (url) {