Skip to content

Commit

Permalink
Making sure all access to self.runningOperations is synchronized
Browse files Browse the repository at this point in the history
  • Loading branch information
bpoplauschi committed Oct 25, 2015
1 parent ac98896 commit 04a0431
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion SDWebImage/SDWebImageManager.m
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,11 @@ - (void)cancelAll {
}

- (BOOL)isRunning {
return self.runningOperations.count > 0;
BOOL isRunning = NO;
@synchronized(self.runningOperations) {
isRunning = (self.runningOperations.count > 0);
}
return isRunning;
}

@end
Expand Down

0 comments on commit 04a0431

Please sign in to comment.