Fix crashes on 64bit devices by casting objc_msgSend calls

This commit is contained in:
Alex Burgel 2013-10-31 15:02:19 -04:00
parent 06474aacb0
commit 39f6b586cc
1 changed files with 10 additions and 10 deletions

View File

@ -271,7 +271,7 @@ static SDWebImageManager *instance;
}
if ([delegate respondsToSelector:@selector(webImageManager:didFinishWithImage:forURL:)])
{
objc_msgSend(delegate, @selector(webImageManager:didFinishWithImage:forURL:), self, image, url);
((void ( *)(id, SEL, id, id, id))objc_msgSend)(delegate, @selector(webImageManager:didFinishWithImage:forURL:), self, image, url);
}
if ([delegate respondsToSelector:@selector(webImageManager:didFinishWithImage:forURL:userInfo:)])
{
@ -280,7 +280,7 @@ static SDWebImageManager *instance;
{
userInfo = nil;
}
objc_msgSend(delegate, @selector(webImageManager:didFinishWithImage:forURL:userInfo:), self, image, url, userInfo);
((void ( *)(id, SEL, id, id, id, id))objc_msgSend)(delegate, @selector(webImageManager:didFinishWithImage:forURL:userInfo:), self, image, url, userInfo);
}
#if NS_BLOCKS_AVAILABLE
if ([info objectForKey:@"success"])
@ -379,7 +379,7 @@ static SDWebImageManager *instance;
if ([delegate respondsToSelector:@selector(webImageManager:didProgressWithPartialImage:forURL:)])
{
objc_msgSend(delegate, @selector(webImageManager:didProgressWithPartialImage:forURL:), self, image, downloader.url);
((void ( *)(id, SEL, id, id, id))objc_msgSend)(delegate, @selector(webImageManager:didProgressWithPartialImage:forURL:), self, image, downloader.url);
}
if ([delegate respondsToSelector:@selector(webImageManager:didProgressWithPartialImage:forURL:userInfo:)])
{
@ -388,7 +388,7 @@ static SDWebImageManager *instance;
{
userInfo = nil;
}
objc_msgSend(delegate, @selector(webImageManager:didProgressWithPartialImage:forURL:userInfo:), self, image, downloader.url, userInfo);
((void ( *)(id, SEL, id, id, id, id))objc_msgSend)(delegate, @selector(webImageManager:didProgressWithPartialImage:forURL:userInfo:), self, image, downloader.url, userInfo);
}
// Delegate notified. Break out and restart loop
found = YES;
@ -430,7 +430,7 @@ static SDWebImageManager *instance;
}
if ([delegate respondsToSelector:@selector(webImageManager:didFinishWithImage:forURL:)])
{
objc_msgSend(delegate, @selector(webImageManager:didFinishWithImage:forURL:), self, image, downloader.url);
((void ( *)(id, SEL, id, id, id))objc_msgSend)(delegate, @selector(webImageManager:didFinishWithImage:forURL:), self, image, downloader.url);
}
if ([delegate respondsToSelector:@selector(webImageManager:didFinishWithImage:forURL:userInfo:)])
{
@ -439,7 +439,7 @@ static SDWebImageManager *instance;
{
userInfo = nil;
}
objc_msgSend(delegate, @selector(webImageManager:didFinishWithImage:forURL:userInfo:), self, image, downloader.url, userInfo);
((void ( *)(id, SEL, id, id, id, id))objc_msgSend)(delegate, @selector(webImageManager:didFinishWithImage:forURL:userInfo:), self, image, downloader.url, userInfo);
}
#if NS_BLOCKS_AVAILABLE
if ([info objectForKey:@"success"])
@ -457,7 +457,7 @@ static SDWebImageManager *instance;
}
if ([delegate respondsToSelector:@selector(webImageManager:didFailWithError:forURL:)])
{
objc_msgSend(delegate, @selector(webImageManager:didFailWithError:forURL:), self, nil, downloader.url);
((void ( *)(id, SEL, id, id, id))objc_msgSend)(delegate, @selector(webImageManager:didFailWithError:forURL:), self, nil, downloader.url);
}
if ([delegate respondsToSelector:@selector(webImageManager:didFailWithError:forURL:userInfo:)])
{
@ -466,7 +466,7 @@ static SDWebImageManager *instance;
{
userInfo = nil;
}
objc_msgSend(delegate, @selector(webImageManager:didFailWithError:forURL:userInfo:), self, nil, downloader.url, userInfo);
((void ( *)(id, SEL, id, id, id, id))objc_msgSend)(delegate, @selector(webImageManager:didFailWithError:forURL:userInfo:), self, nil, downloader.url, userInfo);
}
#if NS_BLOCKS_AVAILABLE
if ([info objectForKey:@"failure"])
@ -536,7 +536,7 @@ static SDWebImageManager *instance;
}
if ([delegate respondsToSelector:@selector(webImageManager:didFailWithError:forURL:)])
{
objc_msgSend(delegate, @selector(webImageManager:didFailWithError:forURL:), self, error, downloader.url);
((void ( *)(id, SEL, id, id, id))objc_msgSend)(delegate, @selector(webImageManager:didFailWithError:forURL:), self, error, downloader.url);
}
if ([delegate respondsToSelector:@selector(webImageManager:didFailWithError:forURL:userInfo:)])
{
@ -545,7 +545,7 @@ static SDWebImageManager *instance;
{
userInfo = nil;
}
objc_msgSend(delegate, @selector(webImageManager:didFailWithError:forURL:userInfo:), self, error, downloader.url, userInfo);
((void ( *)(id, SEL, id, id, id, id))objc_msgSend)(delegate, @selector(webImageManager:didFailWithError:forURL:userInfo:), self, error, downloader.url, userInfo);
}
#if NS_BLOCKS_AVAILABLE
if ([info objectForKey:@"failure"])