diff --git a/WordPress/Classes/ViewRelated/QR Login/Helpers/QRLoginCameraSession.swift b/WordPress/Classes/ViewRelated/QR Login/Helpers/QRLoginCameraSession.swift index f8a51fb77cc3..0527adce1705 100644 --- a/WordPress/Classes/ViewRelated/QR Login/Helpers/QRLoginCameraSession.swift +++ b/WordPress/Classes/ViewRelated/QR Login/Helpers/QRLoginCameraSession.swift @@ -23,7 +23,7 @@ class QRLoginCameraSession: NSObject, QRCodeScanningSession { return AVCaptureVideoPreviewLayer(session: session) } - var scanningDelegate: QRCodeScanningDelegate? + weak var scanningDelegate: QRCodeScanningDelegate? func configure() { configureCamera() diff --git a/WordPress/Classes/ViewRelated/QR Login/Helpers/QRLoginProtocols.swift b/WordPress/Classes/ViewRelated/QR Login/Helpers/QRLoginProtocols.swift index 43534801c62b..9cb55aa46a99 100644 --- a/WordPress/Classes/ViewRelated/QR Login/Helpers/QRLoginProtocols.swift +++ b/WordPress/Classes/ViewRelated/QR Login/Helpers/QRLoginProtocols.swift @@ -51,7 +51,7 @@ protocol QRCameraPermissionsHandler: CameraPermissionsHandler { } /// A delegate that handles when a code was scanned and whether its valid or not -protocol QRCodeScanningDelegate { +protocol QRCodeScanningDelegate: AnyObject { func validLink(_ stringValue: String) -> Bool func didScanURLString(_ urlString: String) } diff --git a/WordPress/Classes/ViewRelated/Views/RichTextView/RichTextView.swift b/WordPress/Classes/ViewRelated/Views/RichTextView/RichTextView.swift index 0ca9d176431f..ca3cb5e31c40 100644 --- a/WordPress/Classes/ViewRelated/Views/RichTextView/RichTextView.swift +++ b/WordPress/Classes/ViewRelated/Views/RichTextView/RichTextView.swift @@ -12,8 +12,8 @@ import UniformTypeIdentifiers @objc open class RichTextView: UIView, UITextViewDelegate { - @objc open var dataSource: RichTextViewDataSource? - @objc open var delegate: RichTextViewDelegate? + @objc open weak var dataSource: RichTextViewDataSource? + @objc open weak var delegate: RichTextViewDelegate? // MARK: - Initializers diff --git a/WordPress/WordPressTest/QRLogin/QRLoginScanningCoordinatorTests.swift b/WordPress/WordPressTest/QRLogin/QRLoginScanningCoordinatorTests.swift index 134cf22858f8..164c49e03169 100644 --- a/WordPress/WordPressTest/QRLogin/QRLoginScanningCoordinatorTests.swift +++ b/WordPress/WordPressTest/QRLogin/QRLoginScanningCoordinatorTests.swift @@ -125,7 +125,7 @@ private class QRCodeScanningSessionMock: QRCodeScanningSession { var hasCamera: Bool = true var session: AVCaptureSession? = nil var previewLayer: CALayer? = nil - var scanningDelegate: QRCodeScanningDelegate? = nil + weak var scanningDelegate: QRCodeScanningDelegate? = nil var isConfigured: Bool = false func configure() {