使用仪器时出现内存泄漏问题
我正在使用仪器检查内存泄漏,并在下面的代码中发现了泄漏
- (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event {
self.highlighted = 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];
}
但是,我完全无法理解上述行中的泄漏是什么。仪器中还显示了许多类似的泄漏。谁能帮我解决这些问题...谢谢。
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.highlighted = 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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
很难说这里的漏洞在哪里,因为没有人看到全貌。您必须跟踪堆栈跟踪,直到到达对系统库的某些调用。这将是您应该搜索泄漏的端点。这并不意味着泄漏确实存在。但那里肯定会有一个泄漏的物体。
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.