Skip to content

Dispose layout manager when embeddable control root is disposed. #14341

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

Merged
merged 1 commit into from
Jan 25, 2024

Conversation

emmauss
Copy link
Contributor

@emmauss emmauss commented Jan 24, 2024

What does the pull request do?

Disposes LayoutManager when EmbeddableControlRoot is disposed.

What is the current behavior?

LayoutManager isn't disposed when EmbeddableControlRoot is no longer needed. This causes an issue on platforms where the root platform view can be recreated at any time, thus creating a new avalonia toplevel, like on Android. Because the old layout is never removed from the MediaContext, it attempts to layout controls on the next layout pass, when a new toplevel and layoutmanager is already created. This throws the following exception;
System.ArgumentException: 'Attempt to call InvalidateArrange on wrong LayoutManager.'

What is the updated/expected behavior with this PR?

How was the solution implemented (if it's not obvious)?

Checklist

Breaking changes

Obsoletions / Deprecations

Fixed issues

Fixes #14083

@maxkatz6 maxkatz6 added the backport-candidate-11.0.x Consider this PR for backporting to 11.0 branch label Jan 25, 2024
@maxkatz6 maxkatz6 merged commit f556f8a into master Jan 25, 2024
@maxkatz6 maxkatz6 deleted the embeddable_root_layout_dispose branch January 25, 2024 01:07
@maxkatz6 maxkatz6 added backported-11.0.x and removed backport-candidate-11.0.x Consider this PR for backporting to 11.0 branch labels Feb 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Error when changing app from full-screen to half-screen on Android with 'Attempt to call InvalidateArrange on wrong LayoutManager'
2 participants