Skip to content

fix :leaks contribution fragment#6716

Open
rovertrack wants to merge 1 commit intocommons-app:mainfrom
rovertrack:contributions
Open

fix :leaks contribution fragment#6716
rovertrack wants to merge 1 commit intocommons-app:mainfrom
rovertrack:contributions

Conversation

@rovertrack
Copy link
Contributor

@rovertrack rovertrack commented Mar 9, 2026

follow up for #6705

Fixes #6692

What changes did you make and why?
ContributionController.kt

  • Added a cleanup() method to nullify locationPermissionCallback and locationPermissionsHelper

ContributionsFragment.kt

  • Calls the cleanup method contributionController?.cleanup() in onDestroyView()
  • Added cleanup logic to nullify mediaDetailPagerFragment to prevent leaking it when removed

ContributionsListFragment.k

  • Nullifies controller as the leak persisted when tab switching

MainActivity.kt

  • In freeUpFragments(), nullifies contributionsFragment which was previously left out causing a leak
  • Updated loadFragment to reuse contributionsFragment without leaking it

Screenshots (for UI changes only)
Screenshot_2026-03-09-19-28-42-31_062c6066f629c24413cc8efde3bd9f38
Screenshot_2026-03-09-19-28-55-15_062c6066f629c24413cc8efde3bd9f38

@github-actions
Copy link

github-actions bot commented Mar 9, 2026

✅ Generated APK variants!

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ANR at Media Detail Fragment & Contribution Fragment

1 participant