Skip to content
This repository was archived by the owner on Apr 19, 2022. It is now read-only.
This repository was archived by the owner on Apr 19, 2022. It is now read-only.

disposing render subscription after onDestroyView #44

@kioba

Description

@kioba

Issue:

this might be an issue if an async event comes back and triggers a render between the onDestroyView and onDestroybecause the fragment view is already destroyed with the onDestroyView but we did not unsubscribe the render subscription.

Clearing the disposables in the fragments happening with the onDestroy event:

override fun onDestroy() { super.onDestroy() disposables.dispose() }

fragment lifecycle:
... onStop onDestroyView onDestroy

Reproducing the issue:
this could be reproduced if you call detach after binding the ViewModel and delaying the state observable.
detach: detach triggers the destruction of the view without calling onDestroy
delay: simulates the late render event

Solution suggestion:
Moving up the bind event to the onStart() and the unsubscription to the onStop() ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions