imageWithCGImage and memory

前端 未结 8 428
既然无缘
既然无缘 2020-12-10 02:24

If I use [UIImage imageWithCGImage:], passing in a CGImageRef, do I then release the CGImageRef or does UIImage take care of this itse

8条回答
  •  忘掉有多难
    2020-12-10 03:10

    I have the same problem in XCode 3.2.1 on Snow Leopard. I have pretty much the same code as Jason.

    I have looked at the iPhone sample code which uses imageWithCGImage and they always release the CGImageRef using CGImageRelease after a call to imageWithCGImage.

    So, is this a bug in the simulator? I always get the malloc_error_break warning on the console when I use CGImageRelease.

提交回复
热议问题