Skip to content

Commit c085882

Browse files
committed
Fix a memory leak issue with the presentationController.
1 parent 7afbaa1 commit c085882

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

Sources/Controller/ImagePickerController+Closure.swift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,9 @@ import Photos
4848
// And since we are using the blocks api. Set ourselfs as delegate
4949
imagePicker.imagePickerDelegate = imagePicker
5050

51+
// Invoke presentationController before actually presenting it to fix a memory leak issue.
52+
_ = imagePicker.presentationController
53+
5154
// Present
5255
self.present(imagePicker, animated: animated, completion: completion)
5356
}

0 commit comments

Comments
 (0)