Skip to content
Permalink
Browse files

Fix final AuthStateMenuItemBinder leak

  • Loading branch information...
chrisbanes committed Nov 7, 2019
1 parent e9e902c commit b4f0a3a879553353a88ee7827de2fef0c8c9c310
@@ -48,7 +48,7 @@ class DiscoverFragment : TiviFragmentWithBinding<FragmentDiscoverBinding>() {

@Inject lateinit var controller: DiscoverEpoxyController

private lateinit var authStateMenuItemBinder: AuthStateMenuItemBinder
private var authStateMenuItemBinder: AuthStateMenuItemBinder? = null

override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
@@ -173,7 +173,7 @@ class DiscoverFragment : TiviFragmentWithBinding<FragmentDiscoverBinding>() {
scheduleStartPostponedTransitions()
}

authStateMenuItemBinder.bind(state.authState, state.user)
authStateMenuItemBinder?.bind(state.authState, state.user)

binding.state = state
controller.state = state
@@ -182,5 +182,6 @@ class DiscoverFragment : TiviFragmentWithBinding<FragmentDiscoverBinding>() {
override fun onDestroyView() {
super.onDestroyView()
controller.clear()
authStateMenuItemBinder = null
}
}
@@ -158,6 +158,7 @@ class WatchedFragment : TiviFragmentWithBinding<FragmentWatchedBinding>() {
super.onDestroyView()
currentActionMode?.finish()
controller.clear()
authStateMenuItemBinder = null
}

private fun startSelectionActionMode() {

0 comments on commit b4f0a3a

Please sign in to comment.
You can’t perform that action at this time.