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
@@ -153,11 +153,11 @@ private struct MediaPreviewViewController: UIViewControllerRepresentable {
class MediaPreviewItem: NSObject, QLPreviewItem {
let file: MediaFileHandleProxy
var previewItemURL: URL? {
nonisolated var previewItemURL: URL? { // nonisolated as QuickLook can call from any thread (macOS 26).
file.url
}
let previewItemTitle: String?
nonisolated let previewItemTitle: String? // nonisolated as QuickLook can call from any thread (macOS 26).
init(file: MediaFileHandleProxy, title: String?) {
self.file = file