mirror of
https://github.com/fork-maintainers/iceraven-browser
synced 2024-11-17 15:26:23 +00:00
[fenix] For https://github.com/mozilla-mobile/fenix/issues/14194 - avoid leak when opening the "Libraries that we use" screen
This commit is contained in:
parent
1e79ff40dc
commit
7f6df6c146
@ -41,7 +41,7 @@ class AboutFragment : Fragment(), AboutPageListener {
|
||||
|
||||
private lateinit var headerAppName: String
|
||||
private lateinit var appName: String
|
||||
private val aboutPageAdapter: AboutPageAdapter = AboutPageAdapter(this)
|
||||
private var aboutPageAdapter: AboutPageAdapter? = AboutPageAdapter(this)
|
||||
|
||||
override fun onCreateView(
|
||||
inflater: LayoutInflater,
|
||||
@ -58,6 +58,10 @@ class AboutFragment : Fragment(), AboutPageListener {
|
||||
}
|
||||
|
||||
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
||||
if (aboutPageAdapter == null) {
|
||||
aboutPageAdapter = AboutPageAdapter(this)
|
||||
}
|
||||
|
||||
about_list.run {
|
||||
adapter = aboutPageAdapter
|
||||
addItemDecoration(
|
||||
@ -76,7 +80,12 @@ class AboutFragment : Fragment(), AboutPageListener {
|
||||
)
|
||||
|
||||
populateAboutHeader()
|
||||
aboutPageAdapter.submitList(populateAboutList())
|
||||
aboutPageAdapter?.submitList(populateAboutList())
|
||||
}
|
||||
|
||||
override fun onDestroyView() {
|
||||
super.onDestroyView()
|
||||
aboutPageAdapter = null
|
||||
}
|
||||
|
||||
private fun populateAboutHeader() {
|
||||
|
Loading…
Reference in New Issue
Block a user