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: Prevent a memory leak on AndroidView which may not call ON_DESTROY #206

Merged
merged 3 commits into from Sep 22, 2022

Conversation

polivmi1
Copy link
Contributor

This PR fixes a memory leak that can happen in AndroidView when navigating to another screen.
The Lifecycle ON_DESTROY event is never called because in onDispose we remove the mapLifecycleObserver and this method is called before the Lifecycle ON_DESTROY event. It will correct the problem that occurred in #188

We have to handle any Lifecycle ON_DESTROY in the onDispose method.


Before submitting your PR, there are a few things you can do to make sure it goes smoothly:

  • Make sure to open a GitHub issue as a bug/feature request before writing your code! That way we can discuss the change, evaluate designs, and agree on the general idea
  • Ensure the tests and linter pass
  • Code coverage does not decrease (if any source code was changed)
  • Appropriate docs were updated (if necessary)

Fixes #138 🦕

@wangela wangela merged commit 7130698 into googlemaps:main Sep 22, 2022
googlemaps-bot pushed a commit that referenced this pull request Sep 22, 2022
## [2.7.2](v2.7.1...v2.7.2) (2022-09-22)

### Bug Fixes

* Prevent a memory leak on AndroidView which may not call ON_DESTROY ([#206](#206)) ([7130698](7130698))
@googlemaps-bot
Copy link
Contributor

🎉 This PR is included in version 2.7.2 🎉

The release is available on:

Your semantic-release bot 📦🚀

@wangela
Copy link
Member

wangela commented Sep 22, 2022

v2.7.2 containing this fix has been released to Maven. Thank you for your contribution @polivmi1!

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

Successfully merging this pull request may close these issues.

Memory leak
3 participants