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

Memory Leak and Crash with iOS17 #158

Open
K-d-y opened this issue Oct 11, 2023 · 1 comment
Open

Memory Leak and Crash with iOS17 #158

K-d-y opened this issue Oct 11, 2023 · 1 comment

Comments

@K-d-y
Copy link

K-d-y commented Oct 11, 2023

Similar problem to the one solved earlier. Playable only on iOS 17. When closing and deinit the screen where CardTextField is located - strong references to CardTextField remain, which leads to application crash.

If user touches CardTextField, enters card number, month, year and CVV, then closes the screen - CardTextField is not released from memory, causing a crash. When entering only the card number, sometimes the crash does not occur.

image

The CardTextField remains in memory because a strong reference to it is stored in the UIKeyboardImpl.

@jigs4444
Copy link

Anyone who is looking for temporary solution , write didDisappear function in the viewcontroller where you are using this cardTextField

    override func viewDidDisappear(_ animated: Bool) {
        super.viewDidDisappear(animated)
        view.endEditing(true)
        view.subviews.forEach { view in
            guard let cardTextfield = view as? CardTextField {
                return
            }
            cardTextfield.removeFromSuperview()
        }
    }

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

2 participants