2
0
mirror of https://github.com/fork-maintainers/iceraven-browser synced 2024-11-09 19:10:42 +00:00

No issue: Fix leaking sessionControlInteractor

This commit is contained in:
ekager 2020-04-17 19:13:43 -07:00 committed by Emily Kager
parent 587bdfbd7b
commit 5014cd78ec

View File

@ -152,7 +152,10 @@ class HomeFragment : Fragment() {
private lateinit var homeAppBarOffSetListener: AppBarLayout.OnOffsetChangedListener private lateinit var homeAppBarOffSetListener: AppBarLayout.OnOffsetChangedListener
private val onboarding by lazy { FenixOnboarding(requireContext()) } private val onboarding by lazy { FenixOnboarding(requireContext()) }
private lateinit var homeFragmentStore: HomeFragmentStore private lateinit var homeFragmentStore: HomeFragmentStore
private lateinit var sessionControlInteractor: SessionControlInteractor private var _sessionControlInteractor: SessionControlInteractor? = null
protected val sessionControlInteractor: SessionControlInteractor
get() = _sessionControlInteractor!!
private var sessionControlView: SessionControlView? = null private var sessionControlView: SessionControlView? = null
private lateinit var currentMode: CurrentMode private lateinit var currentMode: CurrentMode
@ -201,7 +204,7 @@ class HomeFragment : Fragment() {
) )
} }
sessionControlInteractor = SessionControlInteractor( _sessionControlInteractor = SessionControlInteractor(
DefaultSessionControlController( DefaultSessionControlController(
store = requireComponents.core.store, store = requireComponents.core.store,
activity = activity, activity = activity,
@ -356,6 +359,7 @@ class HomeFragment : Fragment() {
override fun onDestroyView() { override fun onDestroyView() {
super.onDestroyView() super.onDestroyView()
_sessionControlInteractor = null
sessionControlView = null sessionControlView = null
view!!.homeAppBar.removeOnOffsetChangedListener(homeAppBarOffSetListener) view!!.homeAppBar.removeOnOffsetChangedListener(homeAppBarOffSetListener)
} }