Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

.delegate(self) cause a memory leak #48

Open
Channe opened this issue Dec 6, 2024 · 0 comments
Open

.delegate(self) cause a memory leak #48

Channe opened this issue Dec 6, 2024 · 0 comments

Comments

@Channe
Copy link

Channe commented Dec 6, 2024

If I add a .delegate(self) to FlexLayoutViewController in demo project, it causes FlexLayoutViewController not to call the deinit method.

extension FlexLayoutViewController: UIScrollViewDelegate {
    func scrollViewDidScroll(_ scrollView: UIScrollView) {
      print("scrollViewDidScroll")
    }
}

class FlexLayoutViewController: ComponentViewController {
    deinit {
        print("FlexLayoutViewController deinit")
    }
}

line 72: add .delegate(self)

                    VStack {
                        Space(height: 10)
                        Text("VStack")
                        VStack(spacing: 10) {
                            for index in 0...10 {
                                Box(index)
                            }
                        }
                        .inset(10).scrollView()
                        .delegate(self)
                        .showsVerticalScrollIndicator(false).size(height: 310)
                    }
                    .inset(h: 10).styleColor(.systemGray4)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant