Skip to content

Commit

Permalink
clearing bindingInitHandler on binding releasing
Browse files Browse the repository at this point in the history
  • Loading branch information
UtkonosCorp committed Apr 15, 2021
1 parent ef1ccf2 commit c90f2d9
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class DataBindingManager(private val component: Component<*, *>) {

private var currentLayoutResId: Int? = null

private val handler = Handler(Looper.getMainLooper())
private val bindingInitHandler = Handler(Looper.getMainLooper())

internal fun updateBinding(
newLayoutResId: Int?,
Expand Down Expand Up @@ -75,7 +75,7 @@ class DataBindingManager(private val component: Component<*, *>) {
executeBindingsImmediately = executeBindingsImmediately
)
else
handler.post {
bindingInitHandler.post {
component.render(
rebindViewModel = false,
executeBindingsImmediately = executeBindingsImmediately
Expand All @@ -86,5 +86,6 @@ class DataBindingManager(private val component: Component<*, *>) {
fun releaseBinding() {
currentBinding = null
currentLayoutResId = null
bindingInitHandler.removeCallbacksAndMessages(null)
}
}

0 comments on commit c90f2d9

Please sign in to comment.