简体   繁体   English

潜在的内存泄漏 - 收到的内存警告

[英]Potential memory leak - Received Memory Warning

I am using iOS 7 and I am getting memory warnings in this part of code, but I'am not able to understand how the retain count increases as I release imageToSave variable too. 我正在使用iOS 7,我在这部分代码中收到了内存警告,但我无法理解保留计数如何增加,因为我也发布了imageToSave变量。

这是我分析代码时的代码图像

静态分析器并不总是写有关内存泄漏但是它假设当你调用finalOutput它会返回一个已分配的对象意味着+1保留计数对象,它永远不会被使用,它将这个waring视为内存泄漏!

You have not allocated memory to this object yourself, so you don't own it. 您自己没有为此对象分配内存,因此您不拥有它。 And you are still releasing it.You can't release objects you don't own. 你还在发布它。你不能发布你不拥有的对象。 Unless you use alloc method to allocate memory, you can't just release them........ 除非你使用alloc方法来分配内存,否则你不能只释放它们........

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

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