From f356b86c2942eaf01e3808dbd40b9d77a0bde3ac Mon Sep 17 00:00:00 2001 From: Kevin Cador Date: Tue, 13 Aug 2013 10:40:46 +0200 Subject: [PATCH] The callbacksForURL: method of SDWebImageDownloader now returns a copied array. This should fix the crash in multithread environment such as: Collection <__NSArrayM: 0x226d9310> was mutated while being enumerated. --- SDWebImage/SDWebImageDownloader.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SDWebImage/SDWebImageDownloader.m b/SDWebImage/SDWebImageDownloader.m index 10cd983e..063056fe 100644 --- a/SDWebImage/SDWebImageDownloader.m +++ b/SDWebImage/SDWebImageDownloader.m @@ -208,7 +208,7 @@ static NSString *const kCompletedCallbackKey = @"completed"; { callbacksForURL = self.URLCallbacks[url]; }); - return callbacksForURL; + return [callbacksForURL copy]; } - (void)removeCallbacksForURL:(NSURL *)url