You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This leak appears when navigation back and forth between 2 fragment using a toolbar linked to Navigation Component via NavigationUI.setupWithNavController(toolbar, navController, configuration).
When checking out the code, AbstractAppBarOnDestinationChangedListener is keeping a strong reference over the context which is causing the leak
It's not a false positive, this is a real leak: UserDetails here is a parent fragment that was destroyed, UserDetails is leaking.
It's hard to figure out the details just from this leak trace, a heap dump or a working repro example project would help.
I highly suspect that FragmentManagerImpl is destroyed as well
Separate note: we should read & surface FragmentManagerImpl.mDestroyed in AndroidObjectInspectors.
I have to guess a little, but it looks like this is a real leak in your application code, it's one of two things:
Either the NavHostController was created for the UserDetails fragment or one of its children. If that's the case, then com.example.feature.home.ui.HomeFragment should not keep a reference to homeNav after UserDetails is destroyed
Or the code that is setting up the androidx.navigation.ui.ToolbarOnDestinationChangedListener as a destination listener is forgetting to remove it when UserDetails is destroyed.
Hello,
I think this leak is a false positive from navigation component. I'm using
This leak appears when navigation back and forth between 2 fragment using a toolbar linked to Navigation Component via
NavigationUI.setupWithNavController(toolbar, navController, configuration)
.When checking out the code,
AbstractAppBarOnDestinationChangedListener
is keeping a strong reference over the context which is causing the leakLeakTrace information
The text was updated successfully, but these errors were encountered: