Permalink
Browse files

Potential strong cycle fixed.

  • Loading branch information...
1 parent ee9af64 commit c77652755a347aca3bb55be29687239a40c461d4 @Vyazovoy Vyazovoy committed Mar 27, 2013
Showing with 3 additions and 2 deletions.
  1. +3 −2 Examples/SDWebImage Demo/DetailViewController.m
View
5 Examples/SDWebImage Demo/DetailViewController.m
@@ -34,12 +34,13 @@ - (void)configureView
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];
}
}

0 comments on commit c776527

Please sign in to comment.