From a18559fe9cae5c000d26c345bf55230532622320 Mon Sep 17 00:00:00 2001 From: Piotr Bernad Date: Thu, 30 Nov 2017 14:02:17 +0100 Subject: [PATCH] Unowned refrence when taking picutre fix --- Source/ImagePickerController.swift | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Source/ImagePickerController.swift b/Source/ImagePickerController.swift index ed2fae94..a9643f6e 100644 --- a/Source/ImagePickerController.swift +++ b/Source/ImagePickerController.swift @@ -333,7 +333,8 @@ open class ImagePickerController: UIViewController { isTakingPicture = true bottomContainer.pickerButton.isEnabled = false bottomContainer.stackView.startLoader() - let action: () -> Void = { [unowned self] in + let action: () -> Void = { [weak self] in + guard let `self` = self else { return } self.cameraController.takePicture { self.isTakingPicture = false } }