tseisel
10/20/2020, 7:04 AMFragment.onDestroyView()
, unless you are not storing binding object as class field. As a Kotlin developer, what approach are you using to avoid repeating this boilerplate for all fragments ? Delegated property ?gildor
10/20/2020, 7:08 AMunless you are not storing binding object as class fieldwhich sounds like a good idea
ephemient
10/20/2020, 8:02 AMephemient
10/20/2020, 8:03 AMgildor
10/20/2020, 8:07 AMephemient
10/20/2020, 8:07 AMgildor
10/20/2020, 8:43 AMefemoney
10/20/2020, 9:26 AMbinding?.(...)
)arekolek
10/20/2020, 9:32 AMgildor
10/20/2020, 9:33 AMefemoney
10/20/2020, 9:33 AMoverride fun onDestroyView {
super.onDestroyView()
binding = null
}
I believe he misunderstood @ephemient first statementgildor
10/20/2020, 9:34 AMgildor
10/20/2020, 9:35 AMefemoney
10/20/2020, 9:36 AMarekolek
10/20/2020, 9:36 AMreplace
on the FragmentManager?gildor
10/20/2020, 9:39 AMreplace
, but on does fragment is part of back stack or not. Replace fragment without back stack will destroy itefemoney
10/20/2020, 9:43 AMarekolek
10/20/2020, 9:43 AMNulling it out earlier is a sort of optimisation (which may not be necessary)You could say that about a lot of memory leaks then I guess?
gildor
10/20/2020, 9:43 AMgildor
10/20/2020, 9:44 AMefemoney
10/20/2020, 9:45 AMefemoney
10/20/2020, 9:45 AMtseisel
10/20/2020, 11:58 AMarekolek
10/20/2020, 12:21 PMarekolek
10/20/2020, 12:23 PM