From 423d36ffc6a17ae8b5107c2d0fcaafab7b7d1392 Mon Sep 17 00:00:00 2001 From: kboda Date: Tue, 4 Apr 2017 15:49:55 +0200 Subject: [PATCH] Release imageRef in snapStillImage unreleased imageRef causes a memory leak of about 8 MB after every photo, which finally leads to a crash of the app --- ios/lib/ReactNativeCameraKit/CKCamera.m | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ios/lib/ReactNativeCameraKit/CKCamera.m b/ios/lib/ReactNativeCameraKit/CKCamera.m index b67539e..1ce1ef3 100644 --- a/ios/lib/ReactNativeCameraKit/CKCamera.m +++ b/ios/lib/ReactNativeCameraKit/CKCamera.m @@ -534,6 +534,8 @@ RCT_ENUM_CONVERTER(CKCameraZoomMode, (@{ } } }]; + + CGImageRelease(imageRef); } else { //NSLog( @"Could not capture still image: %@", error );