codecadwallader / codemaid

CodeMaid is an open source Visual Studio extension to cleanup and simplify our C#, C++, F#, VB, PHP, PowerShell, JSON, XAML, XML, ASP, HTML, CSS, LESS, SCSS, JavaScript and TypeScript coding.
http://www.codemaid.net
GNU Lesser General Public License v3.0
1.88k stars 353 forks source link

BuildProgressView and RadialProgressBar leak WPF animations #966

Open ryanmolden opened 1 year ago

ryanmolden commented 1 year ago

Both BuildProgressView and RadialProgressBar leak WPF animations due to setting a WPF ProgressBar element's IsIndeterminate property to true. The value of this property needs to either be bound to the visibility of the control or be part of a multi-binding with its current logic + the visibility of the control.

This is causing leaked animations to show up in our internal report (I work on the Visual Studio team) as the number 8 and number 9 most common source of these leaks in 17.5

The WPF bug has been fixed here: https://github.com/dotnet/wpf/issues/6264

But that fix will not be ported back to the WPF version that VS uses, so individual offenders need to be fixed.

codecadwallader commented 1 year ago

Thanks for reporting the issue. I've got a proposed fix up in PR #968. Can you take a look and let me know if that is what you had in mind and will bypass the WPF leak?

ryanmolden commented 1 year ago

The fix looks good, will that also fix RadialProgressBar? It looks like it just hit BuildProgressView.

codecadwallader commented 1 year ago

I don't see that we are using the IsIndeterminate property on the RadilProgressBar, only the BuildProgressView. Does it have to be set even if it's not being used and is always false?

ryanmolden commented 1 year ago

Sorry for the super late reply, not on GitHub much and didn't see any notification. You shouldn't have to set it explicitly, it should default to false. I would have to dig into the dumps we have were we detected RadialProgressBar as an offender, could be a false positive.