From e4ea6aa50f3fd9f325936605b18d99c244e610c3 Mon Sep 17 00:00:00 2001 From: Tiago Pereira Date: Fri, 27 May 2022 22:29:32 +0100 Subject: [PATCH] Fix a memory leak issue with the presentationController. --- Sources/Controller/ImagePickerController+Closure.swift | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Sources/Controller/ImagePickerController+Closure.swift b/Sources/Controller/ImagePickerController+Closure.swift index 2b98e6e1..48174f20 100644 --- a/Sources/Controller/ImagePickerController+Closure.swift +++ b/Sources/Controller/ImagePickerController+Closure.swift @@ -48,6 +48,9 @@ import Photos // And since we are using the blocks api. Set ourselfs as delegate imagePicker.imagePickerDelegate = imagePicker + // Invoke presentationController before actually presenting to fix a memory leak issue. + _ = imagePicker.presentationController + // Present self.present(imagePicker, animated: animated, completion: completion) }