Skip to content

Commit 3a1abfc

Browse files
Update src/CommunityToolkit.Maui.Camera/Views/CameraView.shared.cs
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent 7034ff3 commit 3a1abfc

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/CommunityToolkit.Maui.Camera/Views/CameraView.shared.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ public async Task<Stream> CaptureImage(CancellationToken token)
224224
// Without this SemaphoreSlim, previous calls to this method will fire `MediaCaptured` and/or `MediaCaptureFailed` events causing this method to return the wrong Stream or throw the wrong Exception
225225
await captureImageSemaphoreSlim.WaitAsync(token);
226226

227-
var mediaStreamTCS = new TaskCompletionSource<Stream>();
227+
var mediaStreamTCS = new TaskCompletionSource<Stream>(TaskCreationOptions.RunContinuationsAsynchronously);
228228

229229
MediaCaptured += HandleMediaCaptured;
230230
MediaCaptureFailed += HandleMediaCapturedFailed;

0 commit comments

Comments
 (0)