Opening a context flyout on a text box leaks memory
Describe the bug
Opening a context flyout on a text box leaks memory
To Reproduce
git clone https://github.com/BAndysc/avalonia-bugs-reprogit checkout bug_windows_input_panel- Run the app, press the button to open a new window
- Open a context menu in the text box
- Close the second window
- Memory leak:
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
@maxkatz6 Target no longer keeps a strong reference, but unfortunately the issue is still valid.
The left path is caused by PlacementTarget this time:
Actually, it looks like solving this issue is as simple as resetting the value https://github.com/AvaloniaUI/Avalonia/pull/15478
The PR fixes the left path, but there are still other retention paths
^ The leak is still valid in the latest nightly, can we reopen this issue or should I open a new issue?