Skip to content
Browse files

Merge pull request #23 from bluebrindle/e1e9b1902348f4bfd517d9f707990…

…3b65d3b4a17

Fixed a memory leak in EGOImageLoadConnection
  • Loading branch information...
2 parents 3794726 + e1e9b19 commit 54f84c971bd9a8188f8913f48dc3cab26ae61d39 @shnhrrsn shnhrrsn committed Apr 17, 2012
View
2 Demo/.gitignore
@@ -0,0 +1,2 @@
+EGOPhotoViewer_Demo.xcodeproj/project.xcworkspace/
+EGOPhotoViewer_Demo.xcodeproj/xcuserdata/
View
2 Demo/Classes/DetailViewController.m
@@ -123,7 +123,7 @@ - (void)showPhotoView:(UIBarButtonItem*)sender{
UIPopoverController *popover = [[UIPopoverController alloc] initWithContentViewController:navController];
popover.delegate = self;
[popover presentPopoverFromBarButtonItem:sender permittedArrowDirections:UIPopoverArrowDirectionUp animated:YES];
- popoverController = popover;
+ self.popoverController = popover;
[photoController release];
[navController release];
View
1 Demo/Libraries/EGOImageLoader/EGOImageLoadConnection.m
@@ -90,6 +90,7 @@ - (void)dealloc {
self.delegate = nil;
[_connection release];
[_imageURL release];
+ [_responseData release];
[super dealloc];
}
View
3 Demo/Libraries/EGOImageLoader/EGOImageLoader.m
@@ -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 54f84c9

Please sign in to comment.
Something went wrong with that request. Please try again.