Skip to content

Commit 04a0431

Browse files
committed
Making sure all access to self.runningOperations is synchronized
1 parent ac98896 commit 04a0431

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

SDWebImage/SDWebImageManager.m

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,11 @@ - (void)cancelAll {
301301
}
302302

303303
- (BOOL)isRunning {
304-
return self.runningOperations.count > 0;
304+
BOOL isRunning = NO;
305+
@synchronized(self.runningOperations) {
306+
isRunning = (self.runningOperations.count > 0);
307+
}
308+
return isRunning;
305309
}
306310

307311
@end

0 commit comments

Comments
 (0)