ncapdevi / FragNav

An Android library for managing multiple stacks of fragments
1.5k stars 220 forks source link

Memory Leak when the user closes the dialog shown via FragNavController.showDialogFragment #246

Open artsmvch opened 2 years ago

artsmvch commented 2 years ago

I was profiling my app and noticed that my closed dialog is not being garbage collected. Then I checked the references and found out that the FragNavController was holding a ref, namely the mCurrentDialogFrag field. I suggest you make a weak reference to the current dialog frag instead of a strong reference for such cases.