1

This is a simple single view, single ViewController test app. This app has one button in the ViewController. Accessing the PhotoLibrary does not show any leaks, but the camera shows some leaks when presented and more when dismissed.

Here is code:

import UIKit

class ViewController: UIViewController, UIImagePickerControllerDelegate, UINavigationControllerDelegate {

    let pickerCntrl = UIImagePickerController()

    override func viewDidLoad() {
        super.viewDidLoad()
        pickerCntrl.delegate = self
    }

    override func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()
    }
    @IBAction func takePic(_ sender: Any) {
        pickerCntrl.sourceType = UIImagePickerControllerSourceType.camera
        pickerCntrl.cameraCaptureMode = .photo
        pickerCntrl.allowsEditing = true
        if (UIImagePickerController.isSourceTypeAvailable(UIImagePickerControllerSourceType.camera)){
            self.present(pickerCntrl, animated: true, completion: nil)
        }
    }

    func imagePickerController(_ picker: UIImagePickerController, didFinishPickingMediaWithInfo info: [String : Any]) {
//        let editedCapture = info[UIImagePickerControllerEditedImage] as! UIImage?
//        let origCapture = info[UIImagePickerControllerOriginalImage] as! UIImage?
        self.dismiss(animated: true, completion: nil)
    }

    func imagePickerControllerDidCancel(_ picker: UIImagePickerController) {
        self.dismiss(animated: true, completion: nil)
    }
}

ScreenShot : enter image description here

agent86
  • 105
  • 12
  • The function references refer to functions in the CoreAnimation and CoreGraphics libraries so these appaer to be issues internal to iOS itself. theres likely nothing you can do about these except maybe raise them on the apple forms or submit a bug. Your not using these libraries directly so the issue seems to be out of your control – Scriptable Dec 14 '16 at 15:26
  • Seems to be a relatively new issue. Thanks. – agent86 Dec 14 '16 at 15:32
  • yeah, probably introduced in one of the latest releases, or change to swift 3 – Scriptable Dec 14 '16 at 16:29
  • Have you got any solution to this? I'm having the same issue. – Srdjan May 22 '17 at 16:58

0 Answers0