Fix a crash on macOS when using QuickLook. (#5790)

Introduced by the default @MainActor isolation and macOS being weird with threads.
This commit is contained in:
Doug
2026-06-24 18:34:45 +01:00
committed by GitHub
parent 3c5c1c62e3
commit 605ccc6be7
4 changed files with 29 additions and 15 deletions
@@ -289,8 +289,8 @@ private struct PreviewView: UIViewControllerRepresentable {
}
private class PreviewItem: NSObject, QLPreviewItem {
var previewItemURL: URL?
var previewItemTitle: String?
nonisolated let previewItemURL: URL? // nonisolated as QuickLook can call from any thread (macOS 26).
nonisolated let previewItemTitle: String? // nonisolated as QuickLook can call from any thread (macOS 26).
init(previewItemURL: URL?, previewItemTitle: String?) {
self.previewItemURL = previewItemURL