-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
DataContext bindings in ControlTemplate leak memory #15443
Comments
There are two leaks here:
|
The remaining problem here is that |
Describe the bug
Having a datacontext binding in a ControlTemplate, like:
leads to memory leaks. This can be workaround with an
ItemTemplate
, I think this use case should either work as expected or it should be be completely disallowed with a xaml compiler error.To Reproduce
git clone https://github.com/BAndysc/avalonia-bugs-repro
git checkout bug_template_binding_leak
Without bindings in Template:
Open
MainWindow.axaml
, comment lines https://github.com/BAndysc/avalonia-bugs-repro/blob/bug_template_binding_leak/AvaloniaBugs/MainWindow.axaml#L25-L26Do the same steps - memory will be freed now.
Expected behavior
No response
Avalonia version
0.10, 11.0.x and latest nightly
OS
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: