Potential strong cycle fixed.

This commit is contained in:
Andrew Vyazovoy 2013-03-27 23:44:47 +07:00
parent ee9af6406c
commit c77652755a
1 changed files with 3 additions and 2 deletions

View File

@ -34,12 +34,13 @@
if (self.imageURL)
{
__block UIActivityIndicatorView *activityIndicator;
__weak UIImageView *weakImageView = self.imageView;
[self.imageView setImageWithURL:self.imageURL placeholderImage:nil options:SDWebImageProgressiveDownload progress:^(NSUInteger receivedSize, long long expectedSize)
{
if (!activityIndicator)
{
[self.imageView addSubview:activityIndicator = [UIActivityIndicatorView.alloc initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleGray]];
activityIndicator.center = self.imageView.center;
[weakImageView addSubview:activityIndicator = [UIActivityIndicatorView.alloc initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleGray]];
activityIndicator.center = weakImageView.center;
[activityIndicator startAnimating];
}
}