icerockdev / moko-mvvm

Model-View-ViewModel architecture components for mobile (android & ios) Kotlin Multiplatform development
https://moko.icerock.dev/
Apache License 2.0
995 stars 95 forks source link

WARN: Setting the fragment as the LifecycleOwner might cause memory leaks because views lives shorter than the Fragment. Consider using Fragment's view lifecycle #155

Closed vevar closed 2 years ago

vevar commented 2 years ago

https://github.com/icerockdev/moko-mvvm/blob/b6f2630df03bbd405e5659d85ea7df03f38e5dc7/mvvm-databinding/src/main/kotlin/dev/icerock/moko/mvvm/MvvmFragment.kt#L46

Maybe, will be better: binding.lifecycleOwner = viewLifecycleOwner

Alex009 commented 2 years ago

yes, make sense

otoo-peacemaker commented 2 years ago

yeah..that works fine.

Alex009 commented 2 years ago

will be available in 0.12.0