Zhuinden / fragmentviewbindingdelegate-kt

[ACTIVE] A delegate for making managing the ViewBinding variable in a Fragment simpler.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[Suggestion]: Add a comment don't forget to handle memory leak

Drjacky opened this issue · comments

It'd be nice to have a sample app or, in Readme file, you mentioned to this: https://gist.github.com/Zhuinden/ea3189198938bd16c03db628e084a4fa#gistcomment-3619736
with a code snippet, maybe.
So, developers will be known they have to handle that to prevent memory leaks.

They typically don't have to do that, and it's just general usage of lifecycleObserver over the ViewLifecycle.

Separate observers aren't within scope of the library as I'd probably want to make some doOnDestroy { extension function over the LifecycleOwner/Lifecycle but that's clearly out of scope.

Most of the time, just setting the view to null is enough to resolve any leaks, which is what the lib already does.