You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When it crashes, the execution happens in background thread, I believe the issue is concurrent access to shared variable cancellables.
I am not sure that's the best solution, but adding @MainActor attribute to getInformation() solves the problem for me
#if compiler(>=5.5) && canImport(_Concurrency)
/// Retrieve the YouTubePlayer Information
@MainActor // <<<< this solves the problem for me.
func getInformation()asyncthrows->Information{tryawaitwithCheckedThrowingContinuation{ continuation inself.getInformation(completion: continuation.resume)}}#endif
What are the steps to reproduce?
Here is a piece of code showing how I use YouTubePLayerView
What happened?
The crash occurs on YouTubePlayerWebView+Evaluate.swift:147 on line
.store(in: &self.cancellables)
When it crashes, the execution happens in background thread, I believe the issue is concurrent access to shared variable
cancellables
.I am not sure that's the best solution, but adding
@MainActor
attribute togetInformation()
solves the problem for meWhat are the steps to reproduce?
Here is a piece of code showing how I use YouTubePLayerView
What is the expected behavior?
Not crash would be great :)
The text was updated successfully, but these errors were encountered: