开发者

Problem with memory leaks using instruments

开发者 https://www.devze.com 2023-02-09 00:47 出处:网络
i was checking for memory leaks by using instruments and found a leak in the below code - (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event {

i was checking for memory leaks by using instruments and found a leak in the below code

- (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event {
self.h开发者_开发百科ighlighted = NO;
[[self gridView] selectRow:self.yPosition column:self.xPosition scrollPosition:MFGridViewScrollPositionNone animated:YES];
[self.delegate gridViewCellWasTouched:self];//**showing leak in this line**
[super touchesEnded:touches withEvent:event];

}

But, i completely fail to understand what is the leak in the above mentioned line.. There were many more similar leaks which are being shown in instruments. Can anyone help me with these... Thank you.


It is really hard to say where is the leak here, because nobody sees the whole picture. You have to track down the stack trace until you reach some call to system library. This would be the endpoint from which you should search for the leak. It really doesn't mean that the leak is exactly there. But there would be a leaking object there for sure.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号