If I use [UIImage imageWithCGImage:]
, passing in a CGImageRef
, do I then release the CGImageRef
or does UIImage take care of this itself when it is deallocated?
The documentation isn't entirely clear. It says "This method does not cache the image object."
Originally I called CGImageRelease
on the CGImageRef after passing it to imageWithCGImage:
, but that caused a malloc_error_break
warning in the Simulator claiming a double-free was occurring.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…