简体   繁体   English

为什么将此视为内存泄漏?

[英]Why does this count as a memory leak?

I was searching memory leaks in my app using Instruments and found this: 我正在使用Instruments在我的应用程序中搜索内存泄漏,结果发现:
在此处输入图片说明
Why does it count as memory leak? 为什么将其计为内存泄漏? Shouldn't this be released the next time autorelease pool is drained? 下次自动释放池耗尽时,是否不应该释放它?

My take is that the release on the last line is the release corresponding to the autorelease. 我认为最后一行的发布是与自动发布相对应的发布。 The fact that there is still a retain left supports this. 仍然有保留的事实支持了这一点。 If all retains are balanced the final line would be a release with a RefCt of 0. 如果所有保留都平衡,则最后一行将是RefCt为0的发布。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM