diff --git a/library/src/main/kotlin/com/otaliastudios/elements/Adapter.kt b/library/src/main/kotlin/com/otaliastudios/elements/Adapter.kt index cd09b6e..2efed20 100644 --- a/library/src/main/kotlin/com/otaliastudios/elements/Adapter.kt +++ b/library/src/main/kotlin/com/otaliastudios/elements/Adapter.kt @@ -276,6 +276,7 @@ public final class Adapter private constructor( it.unbind(this) } recyclerViews.clear() + lifecycle.removeObserver(this) } /** diff --git a/library/src/main/kotlin/com/otaliastudios/elements/extensions/DataBindingPresenter.kt b/library/src/main/kotlin/com/otaliastudios/elements/extensions/DataBindingPresenter.kt index 0999f5a..bdbb1ec 100644 --- a/library/src/main/kotlin/com/otaliastudios/elements/extensions/DataBindingPresenter.kt +++ b/library/src/main/kotlin/com/otaliastudios/elements/extensions/DataBindingPresenter.kt @@ -33,6 +33,7 @@ abstract class DataBindingPresenter( @OnLifecycleEvent(Lifecycle.Event.ON_DESTROY) fun onDestroy() { binding.setLifecycleOwner(null) + lifecycle.removeObserver(this) } }) return holder