From 7ce2bfb659519fa0b5c67b99a8e6ac4c0bfa0f6a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aleksandar=20Vacic=CC=81?= Date: Sat, 23 Mar 2024 19:45:34 +0100 Subject: [PATCH] Hm...kind of squint and pretend all is fine. --- .../SchemaCompatibility/NSManagedObjectModel+Data.swift | 4 ++-- Sources/ManagedModels/SwiftUI/ModelContainer+SwiftUI.swift | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Sources/ManagedModels/SchemaCompatibility/NSManagedObjectModel+Data.swift b/Sources/ManagedModels/SchemaCompatibility/NSManagedObjectModel+Data.swift index d42b2c4..23231e0 100644 --- a/Sources/ManagedModels/SchemaCompatibility/NSManagedObjectModel+Data.swift +++ b/Sources/ManagedModels/SchemaCompatibility/NSManagedObjectModel+Data.swift @@ -37,8 +37,8 @@ public extension NSManagedObjectModel { // MARK: - Cached ManagedObjectModels private let lock = NSLock() -private var map = [ Set : NSManagedObjectModel ]() -private let sharedBuilder = SchemaBuilder() +nonisolated(unsafe) private var map = [ Set : NSManagedObjectModel ]() +nonisolated(unsafe) private let sharedBuilder = SchemaBuilder() public extension NSManagedObjectModel { diff --git a/Sources/ManagedModels/SwiftUI/ModelContainer+SwiftUI.swift b/Sources/ManagedModels/SwiftUI/ModelContainer+SwiftUI.swift index c8e5a89..9ff8195 100644 --- a/Sources/ManagedModels/SwiftUI/ModelContainer+SwiftUI.swift +++ b/Sources/ManagedModels/SwiftUI/ModelContainer+SwiftUI.swift @@ -113,7 +113,7 @@ public extension Scene { // MARK: - Primitive // Note: The docs say that a container is only ever created once! So cache it. -private var modelToContainer = [ ObjectIdentifier: NSPersistentContainer ]() +nonisolated(unsafe) private var modelToContainer = [ ObjectIdentifier: NSPersistentContainer ]() private func makeModelContainer( for modelTypes : [ any PersistentModel.Type ],