Skip to content

Explicitly null map reference from renderer#687

Merged
kiryldz merged 2 commits intomainfrom
kdz-fix-leaking-native
Sep 30, 2021
Merged

Explicitly null map reference from renderer#687
kiryldz merged 2 commits intomainfrom
kdz-fix-leaking-native

Conversation

@kiryldz
Copy link
Copy Markdown
Contributor

@kiryldz kiryldz commented Sep 28, 2021

PRs must be submitted under the terms of our Contributor License Agreement CLA.
Fixes: < Link to related issues that will be fixed by this pull request, if they exist >

Pull request checklist:

  • Briefly describe the changes in this PR.
  • Include before/after visuals or gifs if this PR includes visual changes.
  • Write tests for all new functionality. If tests were not written, please explain why.
  • Optimize code for java consumption (@JvmOverloads, @file:JvmName, etc).
  • Add example if relevant.
  • Document any changes to public APIs.
  • Apply changelog label ('breaking change', 'bug 🪲', 'build', 'docs', 'feature 🍏', 'performance ⚡', 'testing 💯') or use the label 'skip changelog'
  • Add an entry inside this element for inclusion in the mapbox-maps-android changelog: <changelog>Fix native memory leak by explicitly nulling map reference from renderer.</changelog>.

Summary of changes

Fix native memory leak by explicitly nulling map reference from renderer.
Additionally refactor code a bit by making MapController more responsible for storing main strong link to MapInterface.

Memory consumption looks now after the fix

image

User impact (optional)

@kiryldz kiryldz force-pushed the kdz-fix-leaking-native branch from ffe9c3c to ca10b56 Compare September 28, 2021 12:51
@kiryldz kiryldz force-pushed the kdz-fix-leaking-native branch from ca10b56 to 245a11c Compare September 30, 2021 10:29
@kiryldz kiryldz changed the title Revisit links to native objects Explicitly free map reference from renderer Sep 30, 2021
@kiryldz kiryldz changed the title Explicitly free map reference from renderer Explicitly null map reference from renderer Sep 30, 2021
@kiryldz kiryldz added the bug 🪲 Something isn't working label Sep 30, 2021
@kiryldz kiryldz self-assigned this Sep 30, 2021
@kiryldz kiryldz requested a review from a team September 30, 2021 10:42
@kiryldz kiryldz marked this pull request as ready for review September 30, 2021 10:42
@kiryldz kiryldz merged commit ecd6f73 into main Sep 30, 2021
@kiryldz kiryldz deleted the kdz-fix-leaking-native branch September 30, 2021 16:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug 🪲 Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants