mirror of
https://github.com/JohnEstropia/CoreStore.git
synced 2026-04-25 10:08:31 +02:00
bandaid solution for over-deallocated sequences bug in swift (for now)
This commit is contained in:
@@ -86,8 +86,6 @@ public extension BaseDataTransaction {
|
||||
"Attempted to import an object of type \(typeName(into.entityClass)) outside the transaction's designated queue."
|
||||
)
|
||||
|
||||
return try autoreleasepool {
|
||||
|
||||
guard T.shouldInsertFromImportSource(source, inTransaction: self) else {
|
||||
|
||||
return nil
|
||||
@@ -97,7 +95,6 @@ public extension BaseDataTransaction {
|
||||
try object.didInsertFromImportSource(source, inTransaction: self)
|
||||
return object
|
||||
}
|
||||
}
|
||||
|
||||
func importObjects<T where T: NSManagedObject, T: ImportableObject>(
|
||||
into: Into<T>,
|
||||
@@ -108,8 +105,6 @@ public extension BaseDataTransaction {
|
||||
"Attempted to import an object of type \(typeName(into.entityClass)) outside the transaction's designated queue."
|
||||
)
|
||||
|
||||
try autoreleasepool {
|
||||
|
||||
for source in sourceArray {
|
||||
|
||||
guard T.shouldInsertFromImportSource(source, inTransaction: self) else {
|
||||
@@ -124,7 +119,6 @@ public extension BaseDataTransaction {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func importObjects<T where T: NSManagedObject, T: ImportableObject>(
|
||||
into: Into<T>,
|
||||
@@ -136,8 +130,6 @@ public extension BaseDataTransaction {
|
||||
"Attempted to import an object of type \(typeName(into.entityClass)) outside the transaction's designated queue."
|
||||
)
|
||||
|
||||
try autoreleasepool {
|
||||
|
||||
var objects = [T]()
|
||||
for source in sourceArray {
|
||||
|
||||
@@ -156,7 +148,6 @@ public extension BaseDataTransaction {
|
||||
}
|
||||
postProcess(sorted: objects)
|
||||
}
|
||||
}
|
||||
|
||||
func importUniqueObject<T where T: NSManagedObject, T: ImportableUniqueObject>(
|
||||
into: Into<T>,
|
||||
@@ -167,8 +158,6 @@ public extension BaseDataTransaction {
|
||||
"Attempted to import an object of type \(typeName(into.entityClass)) outside the transaction's designated queue."
|
||||
)
|
||||
|
||||
return try autoreleasepool {
|
||||
|
||||
let uniqueIDKeyPath = T.uniqueIDKeyPath
|
||||
guard let uniqueIDValue = try T.uniqueIDFromImportSource(source, inTransaction: self) else {
|
||||
|
||||
@@ -193,7 +182,6 @@ public extension BaseDataTransaction {
|
||||
return object
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func importUniqueObjects<T where T: NSManagedObject, T: ImportableUniqueObject>(
|
||||
into: Into<T>,
|
||||
@@ -205,8 +193,6 @@ public extension BaseDataTransaction {
|
||||
"Attempted to import an object of type \(typeName(into.entityClass)) outside the transaction's designated queue."
|
||||
)
|
||||
|
||||
try autoreleasepool {
|
||||
|
||||
var mapping = Dictionary<T.UniqueIDType, T.ImportSource>()
|
||||
for source in sourceArray {
|
||||
|
||||
@@ -263,7 +249,6 @@ public extension BaseDataTransaction {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func importUniqueObjects<T where T: NSManagedObject, T: ImportableUniqueObject>(
|
||||
into: Into<T>,
|
||||
@@ -276,8 +261,6 @@ public extension BaseDataTransaction {
|
||||
"Attempted to import an object of type \(typeName(into.entityClass)) outside the transaction's designated queue."
|
||||
)
|
||||
|
||||
try autoreleasepool {
|
||||
|
||||
var sortedIDs = Array<T.UniqueIDType>()
|
||||
var mapping = Dictionary<T.UniqueIDType, T.ImportSource>()
|
||||
for source in sourceArray {
|
||||
@@ -342,5 +325,4 @@ public extension BaseDataTransaction {
|
||||
|
||||
postProcess(sorted: sortedIDs.flatMap { objects[$0] })
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user