Skip to content

[Maui Embedded] DisconnectHandler not called when view is closed/disposed #18366

@ultimategrandson

Description

@ultimategrandson

Description

I am assuming this is because of my application utilizing Maui Embedded. I am creating a view as per the documentation. However, when I close the ViewController, it does not call DisconnectHandler.

I noticed this when I was implementing a Barcode Reader (using the ZXing MAUI library), the cleanup code that stops the camera from running is in the DisconnectHandler method. When the view is closed, it does not call this and the camera remains running.

Is there a way to cleanup these handlers?

Steps to Reproduce

No response

Link to public reproduction project repository

No response

Version with bug

7.0.96

Is this a regression from previous behavior?

Yes, this used to work in Xamarin.Forms

Last version that worked well

Unknown/Other

Affected platforms

iOS, I was not able test on other platforms

Affected platform versions

No response

Did you find any workaround?

No response

Relevant log output

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-controls-generalGeneral issues that span multiple controls, or common base classes such as View or Elementmigration-compatibilityXamarin.Forms to .NET MAUI Migration, Upgrade Assistant, Try-Convertplatform/ioss/needs-attentionIssue has more information and needs another looks/triagedIssue has been reviewedt/bugSomething isn't workingt/native-embedding

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions