Merge pull request #29 from nonamelive/patch-1
Fixed a potential crash when the delegate retainCount = 1, which means th
This commit is contained in:
commit
4792909c5b
|
@ -197,7 +197,7 @@ static SDWebImageManager *instance;
|
|||
SDWebImageDownloader *aDownloader = [downloaders objectAtIndex:uidx];
|
||||
if (aDownloader == downloader)
|
||||
{
|
||||
id<SDWebImageManagerDelegate> delegate = [downloadDelegates objectAtIndex:uidx];
|
||||
id<SDWebImageManagerDelegate> delegate = [[[downloadDelegates objectAtIndex:uidx] retain] autorelease];
|
||||
|
||||
if (image)
|
||||
{
|
||||
|
@ -251,7 +251,7 @@ static SDWebImageManager *instance;
|
|||
SDWebImageDownloader *aDownloader = [downloaders objectAtIndex:uidx];
|
||||
if (aDownloader == downloader)
|
||||
{
|
||||
id<SDWebImageManagerDelegate> delegate = [downloadDelegates objectAtIndex:uidx];
|
||||
id<SDWebImageManagerDelegate> delegate = [[[downloadDelegates objectAtIndex:uidx] retain] autorelease];
|
||||
|
||||
if ([delegate respondsToSelector:@selector(webImageManager:didFailWithError:)])
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue