Open bitvale opened 1 year ago
This leak happens only with default Carousel
, when using EpoxyModelGroup
with other non Carousel
models all works fine without leaks. Use inflater
from activity while creating fragment's view nor set adapter to null
in onDestroyView()
doesn't help.
I have this problem too
calling my_recycler.recycler_viewpool.clear()
directly fixed this for me. Im using a fragment & i noticed that the pool only clears when the activity is destroyed. cc @juckrit
Tested on Android API 30 and API 33, Epoxy version 5.1.1, Leakcanary version 2.10
Simple app with default
Carousel
insideEpoxyModelGroup
:CarouselEpoxyModel
:R.layout.epoxy_carousel_model
BannerView
:buildModels()
:And in Fragment
onDestroyView
I add this line:epoxyRecycler.clear()
(without this line behavior the same)Leak happens when I navigate to another fragment.
But there is no leak if I don' t use
EpoxyModelGroup
:PS: the code is simplified, the
EpoxyModelGroup
is needed for a more complex ui, but the leak is reproducible with this simpleEpoxyModelGroup
.Leak info: