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

ValueStore keeps DataContext referenced view models when Button Click event is handled - memory leaks #15094

Closed
wieslawsoltes opened this issue Mar 23, 2024 · 1 comment
Labels

Comments

@wieslawsoltes
Copy link
Collaborator

Describe the bug

ValueStore keeps DataContext referenced view models when Botton Click event is handled which causes memory leaks.

The issue is that IsPressed property is set during click handling on the button. When user click button and for example its back navigation the view model references are still kept in ValueStore causes by setting IsPressed property inside a button.

I think this issue is also happening in other places in Avalonia.

To Reproduce

Execute click event on Button and navigate back from view, the references captured by ValueStore / IsPressedProperty changes.

Expected behavior

No memory leaks caused by ValueStore.

Avalonia version

11.0.10, master

OS

No response

Additional context

No response

@wieslawsoltes wieslawsoltes changed the title ValueStore keeps DataContext referenced view models when Botton Click event is handled - memory leaks ValueStore keeps DataContext referenced view models when Button Click event is handled - memory leaks Mar 24, 2024
@wieslawsoltes
Copy link
Collaborator Author

This was actually false positive, the real issue was somewhere else.

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

1 participant