yashigani/YSViewer

Memory not release

sergisolanellas opened this issue · 2 comments

Hello, I installed your contribution and works perfectly, but I profiled my project with allocations, and i detect this problem.

I use ARC and this is the code used:

-(id)init{
...
self.viewer = YSViewer.new;
...
}

-(void)openPhoto{

NSString *urlImg = [[NSString alloc] initWithString:[networkImages objectAtIndex:0]];
NSURL *aURL = [NSURL URLWithString:urlImg];
NSData *data2 = [[NSData alloc] initWithContentsOfURL:aURL];
UIImage *imageDownloaded = [UIImage imageWithData:data2];

self.viewer.image = imageDownloaded;
[self.viewer show];
}

I tried this:

-(id)dealloc{
self.viewer = nil;
}

But the problem persists.

Sorry, i had a retain cycle with another object. The YSViewer is correct.

I'm relieved.