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

fix: memory leak on iOS #322

Merged
merged 2 commits into from
Jan 10, 2024
Merged

fix: memory leak on iOS #322

merged 2 commits into from
Jan 10, 2024

Conversation

kirillzyusko
Copy link
Owner

@kirillzyusko kirillzyusko commented Jan 9, 2024

📜 Description

Fixed memory leak on iOS in paper architecture.

💡 Motivation and Context

I used strong references when specified methods as callbacks. I had to use [weak self] in order to create a weak reference and object can be deallocated properly.

I also tested Fabric, but when I keep view as simple as possible - view still doesn't call deinit.

Closes #317

📢 Changelog

iOS

  • added [weak self] for callbacks in KeyboardMovementObserver and FocusedInputObserver;

🤔 How Has This Been Tested?

Tested in XCode.

📸 Screenshots (if appropriate):

Before After
memory-leak-2.mov
no-memory-leak-trimmed.mov
image image

📝 Checklist

  • CI successfully passed
  • added new mocks and corresponding unit-tests if library API was changed

@kirillzyusko kirillzyusko added 🐛 bug Something isn't working 🍎 iOS iOS specific labels Jan 9, 2024
@kirillzyusko kirillzyusko self-assigned this Jan 9, 2024
Copy link
Contributor

github-actions bot commented Jan 9, 2024

📊 Package size report

Current size Target Size Difference
112264 bytes 112179 bytes 85 bytes 📈

@kirillzyusko kirillzyusko added the 📝 paper Changes specific to old (paper/bridge) architecture label Jan 9, 2024
@kirillzyusko kirillzyusko marked this pull request as ready for review January 9, 2024 22:52
@kirillzyusko kirillzyusko merged commit efa8b94 into main Jan 10, 2024
10 checks passed
@kirillzyusko kirillzyusko deleted the fix/317-ios-memory-leak branch January 10, 2024 08:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 bug Something isn't working 🍎 iOS iOS specific 📝 paper Changes specific to old (paper/bridge) architecture
Projects
None yet
Development

Successfully merging this pull request may close these issues.

iOS memory leak(1.10.0)
1 participant