From 0d389857cf6b03ddb8e3c7f8a2311cc00e9f3910 Mon Sep 17 00:00:00 2001 From: Kris Selden Date: Thu, 9 Oct 2014 16:20:52 -0700 Subject: [PATCH] Fix memory leak of image data in imagePickerControllerReturnImageResult MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- src/ios/CDVCamera.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ios/CDVCamera.m b/src/ios/CDVCamera.m index b2c058a..301187a 100644 --- a/src/ios/CDVCamera.m +++ b/src/ios/CDVCamera.m @@ -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);