mirror of
https://github.com/JohnEstropia/CoreStore.git
synced 2026-04-19 15:31:21 +02:00
attempt to fix closure deallocation bug (#58)
This commit is contained in:
@@ -56,7 +56,7 @@ internal final class CoreStoreFetchedResultsController<T: NSManagedObject>: NSFe
|
|||||||
|
|
||||||
if let from = from {
|
if let from = from {
|
||||||
|
|
||||||
self.reapplyAffectedStores = {
|
self.reapplyAffectedStores = { fetchRequest, context in
|
||||||
|
|
||||||
return from.applyAffectedStoresForFetchedRequest(fetchRequest, context: context)
|
return from.applyAffectedStoresForFetchedRequest(fetchRequest, context: context)
|
||||||
}
|
}
|
||||||
@@ -68,7 +68,7 @@ internal final class CoreStoreFetchedResultsController<T: NSManagedObject>: NSFe
|
|||||||
fatalError("Attempted to create an \(typeName(NSFetchedResultsController)) without a From clause or an NSEntityDescription.")
|
fatalError("Attempted to create an \(typeName(NSFetchedResultsController)) without a From clause or an NSEntityDescription.")
|
||||||
}
|
}
|
||||||
|
|
||||||
self.reapplyAffectedStores = {
|
self.reapplyAffectedStores = { fetchRequest, context in
|
||||||
|
|
||||||
return from.applyAffectedStoresForFetchedRequest(fetchRequest, context: context)
|
return from.applyAffectedStoresForFetchedRequest(fetchRequest, context: context)
|
||||||
}
|
}
|
||||||
@@ -84,7 +84,7 @@ internal final class CoreStoreFetchedResultsController<T: NSManagedObject>: NSFe
|
|||||||
|
|
||||||
internal func performFetchFromSpecifiedStores() throws {
|
internal func performFetchFromSpecifiedStores() throws {
|
||||||
|
|
||||||
if !self.reapplyAffectedStores() {
|
if !self.reapplyAffectedStores(fetchRequest: self.fetchRequest, context: self.managedObjectContext) {
|
||||||
|
|
||||||
CoreStore.log(
|
CoreStore.log(
|
||||||
.Warning,
|
.Warning,
|
||||||
@@ -97,5 +97,5 @@ internal final class CoreStoreFetchedResultsController<T: NSManagedObject>: NSFe
|
|||||||
|
|
||||||
// MARK: Private
|
// MARK: Private
|
||||||
|
|
||||||
private let reapplyAffectedStores: () -> Bool
|
private let reapplyAffectedStores: (fetchRequest: NSFetchRequest, context: NSManagedObjectContext) -> Bool
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user