-
-
Notifications
You must be signed in to change notification settings - Fork 25
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
Exception when returning from parent page #4
Comments
Try to add it in DI as transient and/or override OnDisappearing and set CameraEnabled to false to close the camre before you move out of the page. |
Same problem here. |
OK, I have finally managed to consistently replicate this error from your scenario and found the culprit. |
If the control is placed in a secondary page, when you return to the main page an exception is thrown.
Step to reproduce:
Create a page with your control.
register it in di (optional)
builder.Services.AddSingleton();
From main page:
await Shell.Current.GoToAsync($"{nameof(YourPage}");
From your page
await Shell.Current.GoToAsync($"..");
Exception:
System.ObjectDisposedException: 'Cannot access a disposed object.
Object name: 'AndroidX.Camera.View.PreviewView'.'
The text was updated successfully, but these errors were encountered: