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

ProgressBar IsIndeterminate memory leak #12922

Open
alovegit opened this issue Sep 17, 2023 · 5 comments
Open

ProgressBar IsIndeterminate memory leak #12922

alovegit opened this issue Sep 17, 2023 · 5 comments
Labels

Comments

@alovegit
Copy link

alovegit commented Sep 17, 2023

Describe the bug
Having a ProgressBar with IsIndeterminate="True" causes it and the visual tree to be rooted in animation.

To Reproduce
Steps to reproduce the behavior:

  1. Have a UserControl that contains a ProgressBar with IsIndeterminate="True".
  2. On the main view, have a ContentControl and set its Content property to an instance of the UserControl from step 1.
  3. From code, set the ContentControl's Content property to null.
  4. The ProgressBar is now rooted.

Expected behavior
The ProgressBar is no longer rooted and can be garbage collected.

My workaround was to associate a Behavior on the ProgressBar that sets IsIndeterminate to false when OnDetachedFromVisualTree occurs.

Desktop (please complete the following information):

  • OS: Windows
  • Version 11.0.4
@alovegit alovegit added the bug label Sep 17, 2023
@timunie
Copy link
Contributor

timunie commented Sep 18, 2023

Duplicate of #2881

@timunie timunie marked this as a duplicate of #2881 Sep 18, 2023
@timunie timunie closed this as not planned Won't fix, can't repro, duplicate, stale Sep 18, 2023
@alovegit
Copy link
Author

@timunie I don't see how this is the same issue. The other ticket is referring to an animation of the Value property causing memory to grow. My issue is that the tree gets rooted even when detached from the tree, which is different.

@timunie
Copy link
Contributor

timunie commented Sep 18, 2023

I thought it's the same root cause -> Animation is leaking. But I can reopen if you feel it is a different root cause. @jmacato may know more

@timunie timunie reopened this Sep 18, 2023
@alovegit
Copy link
Author

Yes, definitely different in my opinion. I don't think this is a ProgressBar only issue either, as all animations should be torn down once its associated control is removed from the visual tree, and then recreated again if the control gets re-added to the visual tree.

@timunie
Copy link
Contributor

timunie commented Sep 18, 2023

exactly. general animation issue.

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

No branches or pull requests

2 participants