Skip to content

[BUG] CameraView crashes if exited too quickly on Windows #3171

@zhitaop

Description

@zhitaop

Is there an existing issue for this?

  • I have searched the existing issues

Did you read the "Reporting a bug" section on Contributing file?

Current Behavior

On Windows, if the app exits from the CameraView page while the view is still loading, the app crashes with an exception:

Image

This can happen if user click the "back" button quickly enough to navigate away from the CameraView when the view is still loading

Expected Behavior

The app should not crash

Steps To Reproduce

  1. Open and run project from the reproduction repo
  2. Click the "Open and exit camera page" button. This button simulates opening the camera view page and navigate back by Navigation.PopAsync() after a certain time delay. Optionally set the time delay for camera page to exit, default is 50ms.
  3. Observe the bug

Link to public reproduction project repository

https://github.com/zhitaop/MctCameraViewSample

Environment

- .NET MAUI CommunityToolkit.Maui.Camera: v6.0.0
- OS: Windows 11 Enterprise
- .NET MAUI: 10.0.41

Anything else?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions