即使我确定它们存在,仪器中也不会出现泄漏 [英] No leaks appearing in Instruments, even though I'm sure they exist
问题描述
我正在检查仪器中的泄漏,并且已设置为每秒检查一次,但是没有泄漏出现.
I'm checking for leaks in Instruments, and I've set to check every second, but no leaks are appearing.
我确定我的应用程序中必须有一些东西,是否有任何东西可以阻止这些东西出现?我有什么好方法可以创建泄漏,以便可以测试是否确实在仪器中显示了泄漏?
I'm sure there must be some in my app, is there anything which could stop these from appearing? Is there a good way I can create a leak so that I can test if leaks do show up in Instruments?
谢谢!
推荐答案
如果分配了对象但不再引用该对象,则只会使用工具查找泄漏. 泄漏"的另一种类型是保留对您不想要的内容的引用.这通常发生在哈希表或字典之类的集合中,其中键/值对保留在程序员遗忘的集合中.
You're only going to find leaks with a tool if an object is allocated but no longer referenced. Another type of "leak" is to hold a reference to something that you didn't intend to. This typically happens with a collection like a hash table or a dictionary where key/value pairs get left in the collection that the programmer has forgotten about.
这篇关于即使我确定它们存在,仪器中也不会出现泄漏的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!