nsimage - Objective C- Memory leak with CGDataProviderCopyData -
I am trying to create new developers and a fill color app on objc. When I touch on an image, the color will change, but I've got Mirarik leak with this function, need your help:
- (minus) updates Aimej with collar elected Gone: pause {cgi} NSDTA * data = CGDAPproductCopy data (CGI MegatarGetDetTextWidder (ImageRead)); / Leak here byte * pixel = (byte *) [data bytes]; // Change color ... for (int i = 0; i I remove all code except NSData Defense tries to convey * data = Seedeedatapradatacopeedata and app is still leaking. What you have to release the people know how "data"?
Thanks in advance,
}
// img original image [self.img setImage: self.basicImage ]; Data = zero; [data release];] You are sending a zero conclusive release.
[data release]; data = zero ;} This will work better.
Edit I: This issue is issued with the CGDTroprovertWiddata , then the data pointer you passed CGDTransparentCredit Data Becomes invalid It is expected that for proper use of this function, you have to allocate a buffer for the data and provide the callback to release the data when the provider releases. The best solution for you CGDataProviderCreateWithCFData Instead, taking advantage of toll free bridging between the foundation and core foreign objects. Use:
CGDTet Provider = CGDT providerCreateWithCFData (CFDATAFF) data);
Comments
Post a Comment