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

Reference that makes memory leak #2038

Open
vpavloviclevi9 opened this issue Apr 10, 2024 · 2 comments
Open

Reference that makes memory leak #2038

vpavloviclevi9 opened this issue Apr 10, 2024 · 2 comments

Comments

@vpavloviclevi9
Copy link

Describe the bug
Since version 7.0.0. (also with the latest version 7.0.2) IQKeyboardManager instance holds reference to the last focused text field even keyboard is dismissed, which makes memory leak and side effects on host application (as in my case). With version 6.5.16 no such issues.

To Reproduce
Steps to reproduce the behavior:
Initialize IQKeyboardManager in AppDelegate

IQKeyboardManager.shared.enable = true
IQKeyboardManager.shared.enableAutoToolbar = false
IQKeyboardManager.shared.resignOnTouchOutside = true

Ensure the text field is the focus and dismiss the keyboard. Transition to another ViewController, ensuring it's not retained in the navigation stack. Although the specific ViewController is no longer part of the view hierarchy, it remains in the memory graph, which causes a memory leak and in my case app side effects.

Expected behavior
If keyboard is dismissed it shoudn't hold any reference to input fields.

Screenshots
Here is the memory graph:
image

Demo Project
n/a

Versions

Xcode: 15.3
Mac OS: 14.4.1
Simulator/Device: both on simulator and device
Simulator/Device Name: iPhone 15
Library Version: 7.0.0./ 7.0.1./ 7.0.2.

Additional context
n/a

@hackiftekhar
Copy link
Owner

Thanks for reporting this issue. I'll investigate it and see why this is happening.

@Pnaveen1513
Copy link

IQKeyboardManager.shared.enable = true
IQKeyboardManager.shared.enableAutoToolbar = false
IQKeyboardManager.shared.resignOnTouchOutside = true

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants