mirror of
https://github.com/JohnEstropia/CoreStore.git
synced 2026-11-17 14:21:16 +01:00
Reduce leaking (a little) on the workaround for NSFetchRequest.affectedStores ARC bug
This commit is contained in:
1 parent
4d2ebe4ea8
commit
ed8c7b35e8
8 files changed
+91
-69
No files matched your search
@@ -1123,7 +1123,7 @@ public final class ListMonitor<T: NSManagedObject>: Hashable {
|
||||
self.isPersistentStoreChanging = true
|
||||
|
||||
guard let removedStores = (note.userInfo?[NSRemovedPersistentStoresKey] as? [NSPersistentStore]).flatMap(Set.init)
|
||||
where !Set(self.fetchedResultsController.fetchRequest.affectedStores ?? []).intersect(removedStores).isEmpty else {
|
||||
where !Set((self.fetchedResultsController.fetchRequest as! CoreStoreFetchRequest).safeAffectedStores ?? []).intersect(removedStores).isEmpty else {
|
||||
|
||||
return
|
||||
}
|
||||
@@ -1144,7 +1144,7 @@ public final class ListMonitor<T: NSManagedObject>: Hashable {
|
||||
|
||||
if !self.isPendingRefetch {
|
||||
|
||||
let previousStores = Set(self.fetchedResultsController.fetchRequest.affectedStores ?? [])
|
||||
let previousStores = Set((self.fetchedResultsController.fetchRequest as! CoreStoreFetchRequest).safeAffectedStores ?? [])
|
||||
let currentStores = previousStores
|
||||
.subtract(note.userInfo?[NSRemovedPersistentStoresKey] as? [NSPersistentStore] ?? [])
|
||||
.union(note.userInfo?[NSAddedPersistentStoresKey] as? [NSPersistentStore] ?? [])
|
||||
|
||||
Reference in new issue
Block a user