Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Memory leaks for Carousel.java when Views are getting recycled, e.g. in RecyclerView #715

Open
FloriJann opened this issue Sep 9, 2022 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@FloriJann
Copy link

As far as I can tell, the internal list mList, which holds references to the child views of carousel, is causing this issue.

Whenever the onAttachedToWindow function of Carousel.java gets called, new items will be added to the list mList. As a result, the internal data and the displayed data get out of sync, which results in the wrong data being displayed within the carousel.

In addition mList grows with every call of onAttachedToWindow and never gets cleared.

A simple solution could be to just clear the internal list when onDetachedFromWindow gets called.

@FloriJann FloriJann added the bug Something isn't working label Sep 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants