microsoft / microsoft-ui-xaml

Windows UI Library: the latest Windows 10 native controls and Fluent styles for your applications
MIT License
6.33k stars 675 forks source link

Possible leak in RefreshContainer where it doesn't stop a "Forever" composition animation #9604

Closed Youssef1313 closed 4 months ago

Youssef1313 commented 5 months ago

Describe the bug

https://github.com/microsoft/microsoft-ui-xaml/blob/2a60e27c591846556fa9ec4d8f305afdf0f96dc1/controls/dev/PullToRefresh/RefreshVisualizer/RefreshVisualizer.cpp#L422-L444

This animation apparently never stops?

So, if many RefreshContainers are repeatedly added to visual tree, goes into interacting state, then removed from visual tree, those animations are likely to get stuck?

This shouldn't be a problem for a single RefreshContainer as the next interaction will cause another StartAnimation("RotationAngle", ..) which should stop the previous one.

Steps to reproduce the bug

-

Expected behavior

No response

Screenshots

No response

NuGet package version

None

Windows version

No response

Additional context

No response

github-actions[bot] commented 5 months ago

Hi I'm an AI powered bot that finds similar issues based off the issue title.

Please view the issues below to see if they solve your problem, and if the issue describes your problem please consider closing this one. Thank you!

Open similar issues:

Note: You can give me feedback by thumbs upping or thumbs downing this comment.

codendone commented 5 months ago

Do you see an issue in the running app, or are you just noticing some suspect code?

Youssef1313 commented 5 months ago

Just noticed suspicious code. The only way this can start causing issues is repeated interaction with different RefreshContainers. Each RefreshContainer will keep one animation running unnecessarily, if I understand correctly.

kmahone commented 4 months ago

Once the RefreshContainer is removed from the tree and all references to it go away to RefreshContainer should get destroyed and so should the animation. So there should be no leak.

Are you seeing a leak of the RefreshContainer in this scenario?