Skip to content

Commit

Permalink
Merge pull request enormego#23 from bluebrindle/e1e9b1902348f4bfd517d…
Browse files Browse the repository at this point in the history
…9f7079903b65d3b4a17

Fixed a memory leak in EGOImageLoadConnection
  • Loading branch information
shnhrrsn committed Apr 17, 2012
2 parents 3794726 + e1e9b19 commit 54f84c9
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 3 deletions.
2 changes: 2 additions & 0 deletions Demo/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
EGOPhotoViewer_Demo.xcodeproj/project.xcworkspace/
EGOPhotoViewer_Demo.xcodeproj/xcuserdata/
2 changes: 1 addition & 1 deletion Demo/Classes/DetailViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand Down
1 change: 1 addition & 0 deletions Demo/Libraries/EGOImageLoader/EGOImageLoadConnection.m
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ - (void)dealloc {
self.delegate = nil;
[_connection release];
[_imageURL release];
[_responseData release];
[super dealloc];
}

Expand Down
3 changes: 1 addition & 2 deletions Demo/Libraries/EGOImageLoader/EGOImageLoader.m
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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];
Expand Down

0 comments on commit 54f84c9

Please sign in to comment.