iOS-使用VPImageCropper时Analyze 出现Potential leak of an object stored into 'subImageRef'
来源:互联网 发布:微信小说分销系统源码 编辑:程序博客网 时间:2024/05/21 22:31
http://blog.csdn.net/xutianyu930818/article/details/45195851
今天analyze的时候出现这个问题,是用的一个第三方裁剪图片的类叫VPImageCropper,结果发现他里面有问题,看图大家就明白了.在调用CGImageCreateWithImageInRect时subImageRef内存计数+1了,但是在后面用完后却没release.
那么问题来了,这个VPImageCropper是支持ARC的,也就是说系统遇到这边就不好用了,释放不了.这样就会有内存泄露
后来上 stackoverflow 查找 发现这样一段话
ARC does not manage C-types, of which CGImage may be considered. You must release the ref manually when you are finished with CGImageRelease(image);
加上这句话就好了CGImageRelease(subImageRef)
这时我们再来看下,问题解决了~
0 0
- iOS-使用VPImageCropper时Analyze 出现Potential leak of an object stored into 'subImageRef'
- iOS-使用VPImageCropper时Analyze 出现Potential leak of an object stored into 'subImageRef'
- iOS 检测内存泄漏Analyze-Potential leak of an object stored into 'soundFileURLRef'
- potential leak of an object stored into
- potential leak of an object allocated and stored into ...
- Potential leak of an object stored into ‘colorS'
- potential leak of an object stored into xxx
- 在ARC环境:Potential leak of an object
- ARC 中CGColorSpaceRef内存问题 potential leak of an object&nb
- Decodes a String into an object of the specified type
- Potential leak of memory pointed to by 'machine'
- Passing an array or DataTable into a stored procedure
- 新建silverlight项目出现object reference not set to an instance of an object问题
- silverlight项目出现object reference not set to an instance of an object的解决办法
- 打开页面出现Object reference not set to an instance of an object错误
- vs数据库访问出现Object reference not set to an instance of an object. 错误解决办法
- An interesting kind of JavaScript memory leak
- getFiled of an object
- spark详解
- 理解 LSTM 网络
- 论FragmentPagerAdapter与FragmentStatePagerAdapter的区别与使用场景
- dubbo消费者没有指定protocol,服务器端支持dubbo和rest,结果一会走dubbo、一会走rest
- myeclipse10自定义生成注释操作步骤
- iOS-使用VPImageCropper时Analyze 出现Potential leak of an object stored into 'subImageRef'
- 1092. To Buy or Not to Buy
- Python 列表和元组
- 设置Deepin默认软件链接详解
- 欢迎使用CSDN-markdown编辑器
- 关于在Android中限制EditText输入条件的方法
- JAVA之Annotation(二)
- 希尔排序
- npm下载react-native 慢