Skip to content

fix: prevent resource leak in animateToItem#76

Open
Zekfad wants to merge 4 commits into
superlistapp:mainfrom
Zekfad:main
Open

fix: prevent resource leak in animateToItem#76
Zekfad wants to merge 4 commits into
superlistapp:mainfrom
Zekfad:main

Conversation

@Zekfad
Copy link
Copy Markdown

@Zekfad Zekfad commented Jan 6, 2025

resolves #65

@knopp
Copy link
Copy Markdown
Collaborator

knopp commented Jan 6, 2025

I think I'd prefer disposing the animation from ListController.dispose.

@Zekfad
Copy link
Copy Markdown
Author

Zekfad commented Jan 6, 2025

It will cause issues with leaked ticker. Because list can be deleted (and associated ticker provider), but controller will remain with playing animations and will cause problem in mentioned issue.

Comment thread lib/src/super_sliver_list.dart
Comment thread lib/src/super_sliver_list.dart Outdated
@Zekfad
Copy link
Copy Markdown
Author

Zekfad commented Jan 22, 2025

Is there any ETA for a new release?
I'm currently using pubspec override to my git repo with this fix, which is inconvenient for receiving further upstream updates.

Also, talking about this PR, why do you even extract this functionality to a class which is essentially a single method that is immediately called. I don't see any reason for this class to be public also, as it's used only internally.

Maybe it's a good reason to refactor this to a private method?

@gbtb16
Copy link
Copy Markdown

gbtb16 commented Jan 22, 2025

@Zekfad, I agree with what you said!

@CillianMyles, @renancaraujo, @knopp Maybe one of you can take a look at it and fix it, please!

@knopp
Copy link
Copy Markdown
Collaborator

knopp commented Jan 22, 2025

Please don't tag random people! I plan to look at this, but I am currently busy with other work. Also I'd like to see a test in the PR.

@Zekfad
Copy link
Copy Markdown
Author

Zekfad commented Jan 23, 2025

@knopp I've added test for this specific case. You can comment out these lines and test will fail:

https://github.com/superlistapp/super_sliver_list/pull/76/files#diff-5988a0720eec97069caff7143b58f8844be4ab9c7533e495062953b8e5e48666R283-R288

@gbtb16
Copy link
Copy Markdown

gbtb16 commented Jan 23, 2025

@knopp

I can even understand the frustration of getting an unexpected mention. But you are an official maintainer of the repository. Whatever problems there are, you and your colleagues should be responsible for fixing them.

If you're not interested in having that kind of responsibility, consider passing it on to someone else.

We all have jobs to do. And I include myself in that group by having a large repository that needs attention too, even if I have other things to do!

Cheers.

Comment thread lib/src/extent_list.dart
Comment thread lib/src/super_sliver_list.dart
Comment thread pubspec.yaml
Zekfad and others added 4 commits January 23, 2025 19:21
Co-authored-by: Gabriel Tavares <69699209+gbtb16@users.noreply.github.com>
`.toList` has external implementation via `List.of`
@oldHarvester
Copy link
Copy Markdown

@Zekfad thank you for your PR, it helped a lot

@arnab
Copy link
Copy Markdown

arnab commented Apr 15, 2025

Hi folks, is there an update on this PR? I am also seeing the same issue as reported in:

@kturney kturney mentioned this pull request Dec 4, 2025
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

Successfully merging this pull request may close these issues.

I'm having a problem with ListController.animateToItem inside a child OverlayEntry suddenly calling OverlayEntry.remove.

5 participants