Skip to content

Memory Leak and Crash #151

@classic-chris

Description

@classic-chris

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions