File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -74,10 +74,12 @@ public final class InferenceEngine: ObservableObject {
7474 private var generationTask : Task < Void , Never > ?
7575
7676 // All NotificationCenter observers collected for clean deregistration
77- private var observers : [ NSObjectProtocol ] = [ ]
77+ // nonisolated(unsafe): populated exclusively from MainActor init, read only in deinit
78+ // after all strong references have dropped — no concurrent access possible.
79+ // Declared nonisolated(unsafe) to satisfy Swift 6 deinit isolation rules.
80+ nonisolated ( unsafe) private var observers : [ NSObjectProtocol ] = [ ]
7881
79- // Track the model ID that was active before we backgrounded,
80- // so we can restore it when returning to foreground.
82+ // Tracks the model ID active before app backgrounding so we can restore it on foreground.
8183 private var backgroundedModelId : String ?
8284
8385 public init ( ) {
@@ -264,7 +266,7 @@ public final class InferenceEngine: ObservableObject {
264266 currentModelId = nil
265267 state = . idle
266268 ExpertStreamingConfig . shared. deactivate ( )
267- MLX . GPU . set ( cacheLimit: 0 )
269+ MLX . Memory . cacheLimit = 0
268270 }
269271
270272 // MARK: — Generation
You can’t perform that action at this time.
0 commit comments