Fix memory leak of image data in imagePickerControllerReturnImageResult

A __bridge_retained cast increments the count and requires a CFRelease, this should just be __bridge a cast since it isn’t being held onto by this method.

close #51
This commit is contained in:
Kris Selden 2014-10-09 16:20:52 -07:00 committed by Andrew Grieve
parent 8b8db828f6
commit 0d389857cf

View File

@ -632,7 +632,7 @@ static NSSet* org_apache_cordova_validArrowDirections;
CDVPluginResult* result = nil;
if (self.metadata) {
CGImageSourceRef sourceImage = CGImageSourceCreateWithData((__bridge_retained CFDataRef)self.data, NULL);
CGImageSourceRef sourceImage = CGImageSourceCreateWithData((__bridge CFDataRef)self.data, NULL);
CFStringRef sourceType = CGImageSourceGetType(sourceImage);
CGImageDestinationRef destinationImage = CGImageDestinationCreateWithData((__bridge CFMutableDataRef)self.data, sourceType, 1, NULL);