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

Bug: multiple onVisibleChanged calls on LinearDotsLoader leads to multiple scheduled Timer instances #44

Open
code-n-roll opened this issue Nov 8, 2022 · 0 comments

Comments

@code-n-roll
Copy link

code-n-roll commented Nov 8, 2022

bug in these lines
https://github.com/agrawalsuneet/DotLoadersPack-Android/blob/master/dotsloader/src/main/java/com/agrawalsuneet/dotsloader/loaders/LinearDotsLoader.kt#L90-L98

fix is to add cancelling before timer instantiation and scheduling to eliminate racing of cancel vs create&schedule.

private fun scheduleTimer() {
        timer?.cancel()
        timer = Timer()

Reproducible when I created multiple LinearDotsLoader programmatically and one by one show/hide them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant