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

Opening a context flyout on a text box leaks memory #15465

Open
BAndysc opened this issue Apr 22, 2024 · 5 comments · Fixed by #15466
Open

Opening a context flyout on a text box leaks memory #15465

BAndysc opened this issue Apr 22, 2024 · 5 comments · Fixed by #15466
Labels

Comments

@BAndysc
Copy link
Contributor

BAndysc commented Apr 22, 2024

Describe the bug

Opening a context flyout on a text box leaks memory

To Reproduce

  1. git clone https://github.com/BAndysc/avalonia-bugs-repro
  2. git checkout bug_windows_input_panel
  3. Run the app, press the button to open a new window
  4. Open a context menu in the text box
  5. Close the second window
  6. Memory leak:

image

Expected behavior

No response

Avalonia version

11.0.10, 11.2.999-cibuild0047556-alpha

OS

Windows

Additional context

Target is set here: https://github.com/AvaloniaUI/Avalonia/blob/master/src/Avalonia.Controls/Flyouts/PopupFlyoutBase.cs#L238 and will only be released when the next menu is opened

@BAndysc
Copy link
Contributor Author

BAndysc commented Apr 23, 2024

@maxkatz6 Target no longer keeps a strong reference, but unfortunately the issue is still valid.

image

@BAndysc
Copy link
Contributor Author

BAndysc commented Apr 23, 2024

The left path is caused by PlacementTarget this time:

image

@BAndysc
Copy link
Contributor Author

BAndysc commented Apr 23, 2024

Actually, it looks like solving this issue is as simple as resetting the value #15478

@BAndysc
Copy link
Contributor Author

BAndysc commented Apr 23, 2024

The PR fixes the left path, but there are still other retention paths

image

@BAndysc
Copy link
Contributor Author

BAndysc commented Apr 25, 2024

^ The leak is still valid in the latest nightly, can we reopen this issue or should I open a new issue?

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

Successfully merging a pull request may close this issue.

2 participants