iOS - CGImageRef Potential Leak -


i have code:

cgimageref imageref = cgimagecreatewithimageinrect([image cgimage], rect); uiimage *outputimage = [uiimage imagewithcgimage:imageref                                            scale:image.scale                                      orientation:uiimageorientationup]; 

and warning:

object leaked: object allocated , stored 'imageref' not referenced later in execution path , has retain count of +1

but using arc , cannot use release or autorelease. how resolve this?

just add code

cgimagerelease(imageref); 

from cgimagecreatewithimageinrect document,

the resulting image retains reference original image, means may release original image after calling function.

so,what need call cgimagerelease make retain count -1


Comments

Popular posts from this blog

javascript - Complete OpenIDConnect auth when requesting via Ajax -

c# - Replace text in MailItem Body -

java - Get more than One value and display it -