简体   繁体   English

为什么QuartzCore被报告为我的应用程序泄漏?

[英]Why is QuartzCore reported as leaking in my app?

When I view my app's memory in the xcode memory tool, i see that something called QuartzCore is reported as leaking many times. 当我在xcode内存工具中查看我的应用程序的内存时,我看到称为QuartzCore的东西被报告多次泄漏。 Each leak ranges from 16-80 bytes. 每次泄漏的范围为16-80字节。

My code is not referencing this. 我的代码没有引用这个。 it's all from withing UIApplicationMain(). 全部来自于UIApplicationMain()。 So I'm not sure how to control this. 所以我不确定如何控制它。 Any ideas? 有任何想法吗?

Thank you. 谢谢。

Are you using Instruments with the simulator? 您是否在模拟器中使用乐器? The simulator has some memory leaks of its own--you should test for leaks on the device. 模拟器本身有一些内存泄漏-您应该测试设备上的泄漏。 If it leaks on the device, look at the stack trace to see where you allocated memory (it's not always obvious, but 99% of the time it's an error with your code rather than with the framework). 如果它在设备上泄漏,请查看堆栈跟踪以查看在何处分配了内存(这并不总是很明显,但是在99%的情况下,这是代码而不是框架的错误)。

You should use the the Leaks tool to help you to find memory that you have unintentionally failed to clean up. 您应该使用“泄漏”工具来帮助您查找意外清理失败的内存。 There may well be memory that you, or framework developers intentionally want to stick around for the entire running duration of an app. 您或框架开发人员可能会在应用程序的整个运行过程中故意保留一些内存。 Leaks does not know this and will show them as Leaks. 泄漏不知道这一点,会将其显示为泄漏。 If you determine from the Stack Trace that it really wasn't you then you can do nothing about it - even though you would prefer the tool to report zero leaks. 如果您从堆栈跟踪中确定确实不是,那么您将无能为力-即使您希望该工具报告零泄漏。

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

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