From 62e2320f2d69ddb7ef585e32c937a4345bcf437c Mon Sep 17 00:00:00 2001 From: Takeru Chuganji Date: Thu, 26 Feb 2015 09:23:08 +0900 Subject: [PATCH] make sure inmutable --- SDWebImage/SDWebImageDownloader.m | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/SDWebImage/SDWebImageDownloader.m b/SDWebImage/SDWebImageDownloader.m index 1a5d5c31..aa3f1cbc 100644 --- a/SDWebImage/SDWebImageDownloader.m +++ b/SDWebImage/SDWebImageDownloader.m @@ -138,7 +138,7 @@ static NSString *const kCompletedCallbackKey = @"completed"; if (!sself) return; __block NSArray *callbacksForURL; dispatch_sync(sself.barrierQueue, ^{ - callbacksForURL = sself.URLCallbacks[url]; + callbacksForURL = [sself.URLCallbacks[url] copy]; }); for (NSDictionary *callbacks in callbacksForURL) { SDWebImageDownloaderProgressBlock callback = callbacks[kProgressCallbackKey]; @@ -150,7 +150,7 @@ static NSString *const kCompletedCallbackKey = @"completed"; if (!sself) return; __block NSArray *callbacksForURL; dispatch_barrier_sync(sself.barrierQueue, ^{ - callbacksForURL = sself.URLCallbacks[url]; + callbacksForURL = [sself.URLCallbacks[url] copy]; if (finished) { [sself.URLCallbacks removeObjectForKey:url]; }