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

[Android] Avoid to disconnect a disposed PlatformView on Android #12881

Closed
wants to merge 2 commits into from

Conversation

jsuarezruiz
Copy link
Contributor

@jsuarezruiz jsuarezruiz commented Jan 24, 2023

Description of Change

Avoid to disconnect a disposed PlatformView on Android.

Issues Fixed

Fixes #12644
Fixes #13762

@jean-marinduque
Copy link

hi, was wondering when will this be released? I am encountering an issue that this release might fix

Copy link
Member

@PureWeen PureWeen left a comment

Choose a reason for hiding this comment

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

Do we have code anywhere that's disposing of MauiAppCompatEditText ? I wonder why it's getting disposed of in the first place.

Like, if we override dispose on MauiAppCompatEditText can we trigger the conditions of when it gets hit?

I think the bug is with framerenderer and this code here

image

I think when ViewHandlerDelegate we need to not call dispose here and just remove this code.

@jsuarezruiz
Copy link
Contributor Author

jsuarezruiz commented Feb 8, 2023

Do we have code anywhere that's disposing of MauiAppCompatEditText ? I wonder why it's getting disposed of in the first place.

Like, if we override dispose on MauiAppCompatEditText can we trigger the conditions of when it gets hit?

I think the bug is with framerenderer and this code here

image

I think when ViewHandlerDelegate we need to not call dispose here and just remove this code.

I was suspicious of ShellSection and changing tabs but I have not been able to reproduce it, although from the logs it is clearly trying to dispose a MauiAppCompatEditText already disposed. For that reason, I have not added a DeviceTest, I don't know exactly the steps to reproduce.

@jean-marinduque
Copy link

any update?

@PureWeen
Copy link
Member

PureWeen commented Mar 1, 2023

@jean-marinduque do you have a stack trace of your exception?

Copy link
Member

@PureWeen PureWeen left a comment

Choose a reason for hiding this comment

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

Based on the stack trace I think this is a bug inside FrameRenderer

When dispose is called we are calling Dispose on all the children and then calling DisconnectHandler on the Frame

image

I think we need to just remove the call to child?.dispose

The user here specifically calls out that switching to Border fixed the issue.

We should probably also remove the call to dispose inside ViewHandlerDelegator when DisconnectHandler is called as well.

If we want to make a change around checking if the platform view is alive then I wonder if we want to generalize that.

We already have a call called CanInvokeMappers where we won't invoke any mappers when disposed, so maybe we need that for disconnect as well. Ideally we wouldn't :-/ but might not hurt

@github-actions github-actions bot locked and limited conversation to collaborators Dec 14, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
4 participants