iPhone SDK实用程序应用程序模板已泄漏
我只是使用实用程序应用程序模板创建一个项目。 当我按下“信息按钮”时,此模板存在本机内存泄漏 翻转视图。
有人知道我该如何修复这个泄漏吗??? 我只是用这个模板创建一个新项目, 我不添加新对象。
i'm only create an project with a Utility Application template.
This template has a native memory leak when i push "info button" to
flip the view.
Anyone know how can i fix this leak ???
I just make an new project from this template,
i don't add new objects.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(8)
Leaks 也在 CoreGraphics 中为我标记了
open_handle_to_dylib_path
; 这里肯定有一些标记。 由于它最重的时候只有 256 字节,我向 Apple 发送了一份错误报告并称其完成。 然后,您可以在 Leaks 的配置中设置规则来忽略该报告。正如 bbum 指出的那样,工作中可能存在严重的巫术。 我严重怀疑苹果会让有漏洞的框架通过质量检查——特别是因为它很容易重现。
Leaks has flagged
open_handle_to_dylib_path
in CoreGraphics for me as well; there is definitely something flagged here. Since it is merely 256 bytes at its heaviest, I fired off a bug report to Apple and called it done. You can then set a rule in Leaks' configuration to ignore the report.As bbum pointed out, there might be serious voodoo at work. I seriously doubt Apple would let leaky frameworks go through QA -- especially since it's so easy to reproduce.
这一定是一个错误。 它出现在 Apple 自己的示例 PageControl 中,可以在此处找到:
http://开发人员。 apple.com/iphone/library/samplecode/PageControl/index.html#//apple_ref/doc/uid/DTS40007795
This must be a bug. It appears in Apple's own example, PageControl, found here:
http://developer.apple.com/iphone/library/samplecode/PageControl/index.html#//apple_ref/doc/uid/DTS40007795
在当前的SDK实用模板中没有泄漏。 您是如何得到模板中存在泄漏的印象的? 它只是分配视图所需的内存。
泄漏是指不存在指针且无法再释放的内存。
In the current SDK utility template is no leak. How did you get the impression there's a leak in the template? It's just allocating memory which is needed for the views.
A leak is memory to which no pointers exist and which cannot be freed any more.
我有同样的问题,但能够理解为什么会发生。 我在此 文章
可能对您有用。
I had the same problem, but was able to understand why it happened. And I have given a brief info regarding this problem in this article
Might be useful for you.
这可能是泄漏,也可能不是泄漏。 如果您要添加分配的回溯,那将会很有帮助。
更有可能的是,这不是泄漏,而是泄漏/仪器丢失的 dyld 隐藏的一些簿记信息。
鉴于它是 128 字节,而且我猜只有其中一个,我鼓励您通过 http 提交错误://bugreport.apple.com,然后暂时忘记它,因为在不太可能的情况下,它确实是泄漏,您同样不可能从应用程序中修复它。
That might be a leak or it might not be a leak. If you were to add the backtrace of the allocation, that would be helpful.
More likely than not, it isn't a leak, but some bookkeeping information that is being stashed away by dyld that leaks/Instruments loses track of.
Given that it is 128 bytes and I'm guessing there is only one of them, I would encourage you to file a bug via http://bugreport.apple.com and then forget about it for now as, in the unlikely case that it really is a leak, you will be equally as unlikely to be able to fix it from within your application.
希望这可以帮助。
来自:http://www.cocos2d-iphone.org/forum/topic/2460
“模拟器存在与单例和 llvm 相关的错误,这些错误由 Instruments 错误报告。请务必检查设备本身的泄漏情况。”
Hope this helps.
From: http://www.cocos2d-iphone.org/forum/topic/2460
"The simulator has bugs related to singletons and llvm stuff that are incorrectly reported by Instruments. Always check your leaks on the device itself."
执行此操作时出现泄漏:
XCode 3.2--
文件、新项目、基于导航的应用程序
给它起个名字
构建它
使用性能工具运行 -> Leaks
当 Instruments 出现时,单击 Leaks(您可能必须单击底部的小图标,该图标看起来像一个框中有四个框)。
运行后大约 7 秒,您应该看到泄漏:
-- Malloc 128 Bytes, some Address, 128 Bytes, CoreGraphics, open_handle_to_dylib_path
我追踪到AppDelegate中的这段代码:
我打破了navigationController(做了单独的分配和释放)并注释了addSubview:操作 - 没有泄漏- 而且,显然,屏幕是空白的。
直到我尝试 addSubview 才发生泄漏。 由于添加子视图的方法有很多,我尝试了这些。 每一个都会导致泄漏或黑屏。
Got the leak doing this:
XCode 3.2--
File, New Project, Navigation-based Application
Give it a name
Build It
Run With Performance Tools -> Leaks
When Instruments comes up, click on Leaks (you might have to click the little icon at the bottom that looks like four boxes within a box)
About 7 seconds after running you should see the leak:
-- Malloc 128 Bytes, some Address, 128 Bytes, CoreGraphics, open_handle_to_dylib_path
I traced it to this code in the AppDelegate:
I broke out the navigationController (did a separate alloc and release) and COMMENTED OUT the addSubview: action - there was no leak - and, obviously, the screen was blank.
It wasn't until I attempted addSubview that the leak occurred. Since there are numerous ways to add a subview, I tried those. Each resulted in the leak or a blank screen.
我在真正的 iPod touch 上尝试过。 没有泄漏的报告。
可能只是一个模拟器的东西......
I tried it on a real ipod touch. No leak was reported.
Probably just a simulator thing ...