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

Fixed memory leak in Switch class #15998

Merged
merged 1 commit into from
Jun 13, 2024

Conversation

ds1709
Copy link
Contributor

@ds1709 ds1709 commented Jun 11, 2024

Fixes #15990

@avaloniaui-bot
Copy link

You can test this PR using the following package version. 11.2.999-cibuild0048955-alpha. (feed url: https://nuget-feed-all.avaloniaui.net/v3/index.json) [PRBUILDID]

@cla-avalonia
Copy link
Collaborator

cla-avalonia commented Jun 11, 2024

  • All contributors have signed the CLA.

@ds1709
Copy link
Contributor Author

ds1709 commented Jun 11, 2024

@cla-avalonia agree

@maxkatz6 maxkatz6 added backport-candidate-11.0.x Consider this PR for backporting to 11.0 branch backport-candidate-11.1.x Consider this PR for backporting to 11.1 branch bug labels Jun 13, 2024
Copy link
Member

@maxkatz6 maxkatz6 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good.
For the context, original code for the Switch operator comes from here:
https://github.com/dotnet/reactive/blob/main/Rx.NET/Source/src/System.Reactive/Linq/Observable/Switch.cs#L58

Where SerialDisposableValue was disposing nested disposable automatically. But this logic was missed while porting to Avalonia. This PR fixes that.

@maxkatz6 maxkatz6 added this pull request to the merge queue Jun 13, 2024
Merged via the queue into AvaloniaUI:master with commit 05f431b Jun 13, 2024
11 checks passed
maxkatz6 pushed a commit that referenced this pull request Aug 12, 2024
@maxkatz6 maxkatz6 added backported-11.1.x and removed backport-candidate-11.1.x Consider this PR for backporting to 11.1 branch labels Aug 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-candidate-11.0.x Consider this PR for backporting to 11.0 branch backported-11.1.x bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Dinamicaly adding/removing MenuItem-s in Menu leads to memory leaks
4 participants