Skip to content

Commit a641108

Browse files
committed
Weak self for root view closures please
1 parent 0b840fd commit a641108

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

WooCommerce/Classes/ViewRelated/Dashboard/Settings/In-Person Payments/InPersonPaymentsViewController.swift

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,12 @@ import SwiftUI
33
final class InPersonPaymentsViewController: UIHostingController<InPersonPaymentsView> {
44
init(viewModel: InPersonPaymentsViewModel) {
55
super.init(rootView: InPersonPaymentsView(viewModel: viewModel))
6-
rootView.showSupport = {
6+
rootView.showSupport = { [weak self] in
7+
guard let self = self else { return }
78
ZendeskProvider.shared.showNewWCPayRequestIfPossible(from: self)
89
}
9-
rootView.showURL = { url in
10+
rootView.showURL = { [weak self] url in
11+
guard let self = self else { return }
1012
WebviewHelper.launch(url, with: self)
1113
}
1214
}

0 commit comments

Comments
 (0)