-
-
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
Dinamicaly adding/removing MenuItem-s in Menu leads to memory leaks #15990
Comments
After a little researche, I found that subscription is cached in public override void OnNext(IObservable<TSource> value)
{
ulong id;
lock (_gate)
{
id = unchecked(++_latest);
_hasLatest = true;
}
var innerObserver = new InnerObserver(this, id);
_innerSerialDisposable?.Dispose(); // <== Added Dispose call before setting new value.
_innerSerialDisposable = innerObserver;
innerObserver.Disposable = value.Subscribe(innerObserver);
} |
@ds1709 probably worth to file a PR |
@timunie I need this fix in version 11.0.*. So, do I need to create two PR, one in branch 11.0 and another in develop? |
@ds1709 for 11.0 this requires probably a support agreement as we are only backporting for upcomming 11.1 at this point of time. |
@timunie is there any problem with support 11.0 version? This fix is not complex, so release 11.0.11 should be easy. |
Limited resources. Nothing else. |
Is there any chance to get this fix in version 11.0? And another question, when is it planned to release version 11.1 (no beta)? According to the commot graph, there are a big amount of improvements from release 11.1.0-beta2. Same for 11.0.10, there are improvements, that wasn't released. |
Thanks for your understanding |
Describe the bug
When adding
MenuItem
-s intoMenu
and then removing them,Menu
keep holding reference to removedMenuItem
-s.Here screenshots from memory profiler.
and quick watch of MenuItem (Parent is null)
and also quick watch of Menu (Items collection is empty)
As you can see,
Menu
keep holding reference on removedMenuItem
throught chain of strong event subscriptions.To Reproduce
Expected behavior
No response
Avalonia version
11.0.10
OS
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: