From 04a0431ae914fd5ea871725edc5af4e0b981ae24 Mon Sep 17 00:00:00 2001 From: Bogdan Poplauschi Date: Sun, 25 Oct 2015 19:35:26 +0200 Subject: [PATCH] Making sure all access to self.runningOperations is synchronized --- SDWebImage/SDWebImageManager.m | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/SDWebImage/SDWebImageManager.m b/SDWebImage/SDWebImageManager.m index 319d8474..6ca47133 100644 --- a/SDWebImage/SDWebImageManager.m +++ b/SDWebImage/SDWebImageManager.m @@ -301,7 +301,11 @@ } - (BOOL)isRunning { - return self.runningOperations.count > 0; + BOOL isRunning = NO; + @synchronized(self.runningOperations) { + isRunning = (self.runningOperations.count > 0); + } + return isRunning; } @end