in Tools/Cam360/MainPage.xaml.cs [588:609]
private async Task CleanupCameraAsync()
{
Debug.WriteLine("CleanupCameraAsync");
if (_isInitialized)
{
if (_isPreviewing)
{
await StopPreviewAsync();
}
// Allow the device to sleep now that the preview is stopped
_displayRequest.RequestRelease();
}
_selectedFrameSource = null;
if (_mediaCapture != null)
{
_mediaCapture.Dispose();
_mediaCapture = null;
_isInitialized = false;
}
}