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 #151

Open
classic-chris opened this issue Apr 4, 2019 · 1 comment
Open

Memory Leak and Crash #151

classic-chris opened this issue Apr 4, 2019 · 1 comment

Comments

@classic-chris
Copy link

classic-chris commented Apr 4, 2019

If the user taps the CardTextField and then pops back from the view controller the expectation is that the CardTextField will be removed from memory because the view controller (or storyboard) should have held the only strong reference to the text field.

Instead the CardTextField remains in memory because a strong reference is retained by the UIKeyboardImpl.

retained_textfield

The only way to release this is for the user to tap a different text field which causes the UIKeyboardImpl to release its reference to CardTextField.

This leak can cause a crash if the user inputs their card number and their expiry month, then taps backspace until the month is cleared but the cursor is still in the month field. Then pop back on the navigation controller, re-enter the screen with the CardTextField and tap in the text field. See the gif below for the exact steps to reproduce:

crash_steps

Here is the sample project to reproduce:
CaishenBug.zip

@classic-chris
Copy link
Author

Pull request opened here addressing this issue.

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