From 1ecffdc3897156ad5bf1500c0cf5583f35ff7845 Mon Sep 17 00:00:00 2001 From: Tony Li Date: Wed, 12 Jul 2023 11:11:29 +1200 Subject: [PATCH] Fix retain cycles in Site Creation --- .../Preview/TemplatePreviewViewController.swift | 4 ++-- .../Site Creation/Site Segments/SiteSegmentsStep.swift | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/WordPress/Classes/ViewRelated/Site Creation/Design Selection/Preview/TemplatePreviewViewController.swift b/WordPress/Classes/ViewRelated/Site Creation/Design Selection/Preview/TemplatePreviewViewController.swift index ce751926e2f5..174da4386d9a 100644 --- a/WordPress/Classes/ViewRelated/Site Creation/Design Selection/Preview/TemplatePreviewViewController.swift +++ b/WordPress/Classes/ViewRelated/Site Creation/Design Selection/Preview/TemplatePreviewViewController.swift @@ -1,7 +1,7 @@ import Foundation -protocol TemplatePreviewViewDelegate { +protocol TemplatePreviewViewDelegate: AnyObject { typealias PreviewDevice = PreviewDeviceSelectionViewController.PreviewDevice func deviceButtonTapped(_ previewDevice: PreviewDevice) func deviceModeChanged(_ previewDevice: PreviewDevice) @@ -20,7 +20,7 @@ class TemplatePreviewViewController: UIViewController, NoResultsViewHost, UIPopo @IBOutlet weak var footerView: UIView! @IBOutlet weak var progressBar: UIProgressView! - internal var delegate: TemplatePreviewViewDelegate? + internal weak var delegate: TemplatePreviewViewDelegate? private let demoURL: String private var estimatedProgressObserver: NSKeyValueObservation? internal var selectedPreviewDevice: PreviewDevice { diff --git a/WordPress/Classes/ViewRelated/Site Creation/Site Segments/SiteSegmentsStep.swift b/WordPress/Classes/ViewRelated/Site Creation/Site Segments/SiteSegmentsStep.swift index de72b3c28418..3b8fdde0de34 100644 --- a/WordPress/Classes/ViewRelated/Site Creation/Site Segments/SiteSegmentsStep.swift +++ b/WordPress/Classes/ViewRelated/Site Creation/Site Segments/SiteSegmentsStep.swift @@ -8,7 +8,7 @@ final class SiteSegmentsStep: WizardStep { return SiteSegmentsWizardContent(service: self.service, selection: self.didSelect) }() - var delegate: WizardDelegate? + weak var delegate: WizardDelegate? init(creator: SiteCreator, service: SiteSegmentsService) { self.creator = creator