Permalink
Browse files

Fix mem leak, EGOImageLoadConnection not releasing _responseData. htt…

  • Loading branch information...
1 parent d732e28 commit e1e9b1902348f4bfd517d9f7079903b65d3b4a17 @crumpf crumpf committed Apr 14, 2011
@@ -90,6 +90,7 @@ - (void)dealloc {
self.delegate = nil;
[_connection release];
[_imageURL release];
+ [_responseData release];
[super dealloc];
}
@@ -115,7 +115,7 @@ - (void)loadImageForURL:(NSURL*)aURL observer:(id<EGOImageLoaderObserver>)observ
- (UIImage*)imageForURL:(NSURL*)aURL shouldLoadWithObserver:(id<EGOImageLoaderObserver>)observer {
if(!aURL) return nil;
- id anImage = [[EGOCache currentCache] imageForKey:keyForURL(aURL)];
+ UIImage* anImage = [[EGOCache currentCache] imageForKey:keyForURL(aURL)];
if(anImage) {
return anImage;
@@ -152,7 +152,6 @@ - (void)imageLoadConnectionDidFinishLoading:(EGOImageLoadConnection *)connection
[[NSNotificationCenter defaultCenter] performSelectorOnMainThread:@selector(postNotification:) withObject:notification waitUntilDone:YES];
} else {
-
[[EGOCache currentCache] setData:connection.responseData forKey:keyForURL(connection.imageURL) withTimeoutInterval:604800];
[currentConnections removeObjectForKey:connection.imageURL];

0 comments on commit e1e9b19

Please sign in to comment.