Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/Sentry.Unity/ScreenshotEventProcessor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ public SentryEvent Process(SentryEvent @event)
if (Interlocked.CompareExchange(ref _isCapturingScreenshot, 1, 0) == 0)
{
_options.LogDebug("Starting coroutine to capture a screenshot.");
// Capture must run on the main thread after WaitForEndOfFrame (ReadPixels needs a complete frame), but the
// event processor pipeline is synchronous and may run on any thread - blocking here would deadlock when
// called from the main thread. So we capture in a coroutine and ship the screenshot as a separate envelope.
_sentryMonoBehaviour.QueueCoroutine(CaptureScreenshotCoroutine(@event));
}

Expand Down
Loading