Skip to content

Commit 3a91345

Browse files
committed
Fix more leaks
1 parent d940a28 commit 3a91345

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

library/src/main/kotlin/com/otaliastudios/elements/Adapter.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -276,6 +276,7 @@ public final class Adapter private constructor(
276276
it.unbind(this)
277277
}
278278
recyclerViews.clear()
279+
lifecycle.removeObserver(this)
279280
}
280281

281282
/**

library/src/main/kotlin/com/otaliastudios/elements/extensions/DataBindingPresenter.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ abstract class DataBindingPresenter<T: Any, DB: ViewDataBinding>(
3333
@OnLifecycleEvent(Lifecycle.Event.ON_DESTROY)
3434
fun onDestroy() {
3535
binding.setLifecycleOwner(null)
36+
lifecycle.removeObserver(this)
3637
}
3738
})
3839
return holder

0 commit comments

Comments
 (0)