bandaid solution for over-deallocated sequences bug in swift (for now)

This commit is contained in:
John Estropia
2015-08-27 19:06:04 +09:00
parent c3ef8a4172
commit ea6b6f2c37

View File

@@ -86,8 +86,6 @@ public extension BaseDataTransaction {
"Attempted to import an object of type \(typeName(into.entityClass)) outside the transaction's designated queue." "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 { guard T.shouldInsertFromImportSource(source, inTransaction: self) else {
return nil return nil
@@ -97,7 +95,6 @@ public extension BaseDataTransaction {
try object.didInsertFromImportSource(source, inTransaction: self) try object.didInsertFromImportSource(source, inTransaction: self)
return object return object
} }
}
func importObjects<T where T: NSManagedObject, T: ImportableObject>( func importObjects<T where T: NSManagedObject, T: ImportableObject>(
into: Into<T>, 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." "Attempted to import an object of type \(typeName(into.entityClass)) outside the transaction's designated queue."
) )
try autoreleasepool {
for source in sourceArray { for source in sourceArray {
guard T.shouldInsertFromImportSource(source, inTransaction: self) else { guard T.shouldInsertFromImportSource(source, inTransaction: self) else {
@@ -124,7 +119,6 @@ public extension BaseDataTransaction {
} }
} }
} }
}
func importObjects<T where T: NSManagedObject, T: ImportableObject>( func importObjects<T where T: NSManagedObject, T: ImportableObject>(
into: Into<T>, 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." "Attempted to import an object of type \(typeName(into.entityClass)) outside the transaction's designated queue."
) )
try autoreleasepool {
var objects = [T]() var objects = [T]()
for source in sourceArray { for source in sourceArray {
@@ -156,7 +148,6 @@ public extension BaseDataTransaction {
} }
postProcess(sorted: objects) postProcess(sorted: objects)
} }
}
func importUniqueObject<T where T: NSManagedObject, T: ImportableUniqueObject>( func importUniqueObject<T where T: NSManagedObject, T: ImportableUniqueObject>(
into: Into<T>, 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." "Attempted to import an object of type \(typeName(into.entityClass)) outside the transaction's designated queue."
) )
return try autoreleasepool {
let uniqueIDKeyPath = T.uniqueIDKeyPath let uniqueIDKeyPath = T.uniqueIDKeyPath
guard let uniqueIDValue = try T.uniqueIDFromImportSource(source, inTransaction: self) else { guard let uniqueIDValue = try T.uniqueIDFromImportSource(source, inTransaction: self) else {
@@ -193,7 +182,6 @@ public extension BaseDataTransaction {
return object return object
} }
} }
}
func importUniqueObjects<T where T: NSManagedObject, T: ImportableUniqueObject>( func importUniqueObjects<T where T: NSManagedObject, T: ImportableUniqueObject>(
into: Into<T>, 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." "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>() var mapping = Dictionary<T.UniqueIDType, T.ImportSource>()
for source in sourceArray { for source in sourceArray {
@@ -263,7 +249,6 @@ public extension BaseDataTransaction {
} }
} }
} }
}
func importUniqueObjects<T where T: NSManagedObject, T: ImportableUniqueObject>( func importUniqueObjects<T where T: NSManagedObject, T: ImportableUniqueObject>(
into: Into<T>, 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." "Attempted to import an object of type \(typeName(into.entityClass)) outside the transaction's designated queue."
) )
try autoreleasepool {
var sortedIDs = Array<T.UniqueIDType>() var sortedIDs = Array<T.UniqueIDType>()
var mapping = Dictionary<T.UniqueIDType, T.ImportSource>() var mapping = Dictionary<T.UniqueIDType, T.ImportSource>()
for source in sourceArray { for source in sourceArray {
@@ -343,4 +326,3 @@ public extension BaseDataTransaction {
postProcess(sorted: sortedIDs.flatMap { objects[$0] }) postProcess(sorted: sortedIDs.flatMap { objects[$0] })
} }
} }
}