您的位置:首页 > 编程语言 > Go语言

Low memory warning with several EGOImageView

2012-10-30 07:34 423 查看
EGOImageView can lead to memory leaks, be aware.

First of all, check if it releases _responseData in EGOImageLoadConnection's dealloc so that it looks like:

- (void)dealloc
{
    self.response = nil;
    self.delegate = nil;
    [_connection release];
    [_imageURL release];
    [_responseData release];  //this line is absent in current EGOImageLoadConnection.m

    [super dealloc];
}


Then call cancelImageLoad when deallocating a view which uses it and nil its image attribute (remember, I use ARC code sample):
- (void)dealloc
 {
    //...
    self.myView.image = nil;
    [self.myView cancelImageLoad];
    //...
 }


And I'd also recommend to call sometimes:
[EGOCache.currentCache clearCache];


Anyway, feel free to use Instruments. Open Allocations instrument, click VM Tracker and set automatic snapshots to 1 sec delay. Then watch Dirty memory
column and Memory Tag 70 line, which shows how much memory images consume in your application.

转帖:http://stackoverflow.com/questions/11437497/low-memory-warning-with-several-egoimageview
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐