当前位置: 动力学知识库 > 问答 > 编程问答 >

cgimage - Does CGImageRelease() free UIImage's memory?

问题描述:

I have the following code:

UIImage *originalImage;

CGImageRef cgImage = [originalImage CGImage];

I know that CGImage is a read-only property of UIImage class.

Does the line

CGImageRelease(cgImage)

free originalImage's memory?

I'm tracing down a bug in my program and this line seems to be a hot candidate if I'm trying to access originalImage later.

Thanks,

Stefan

网友答案:

I've found the answer myself: Because the call

CGImageRef img = [[UIImage imageNamed:@"pic.png"] CGImage];

does not contain one of the words create, copy or alloc, I am not responsible for freeing this memory.

分享给朋友:
您可能感兴趣的文章:
随机阅读: