mirror of
https://github.com/JohnEstropia/CoreStore.git
synced 2026-01-16 22:16:53 +01:00
make unit tests happy
This commit is contained in:
@@ -47,6 +47,10 @@ public final class CSUnsafeDataTransaction: CSBaseDataTransaction {
|
||||
|
||||
self.bridgeToSwift.context.saveAsynchronouslyWithCompletion { (_, error) in
|
||||
|
||||
defer {
|
||||
|
||||
withExtendedLifetime(self, {})
|
||||
}
|
||||
if let error = error {
|
||||
|
||||
failure?(error.bridgeToObjectiveC)
|
||||
@@ -55,7 +59,6 @@ public final class CSUnsafeDataTransaction: CSBaseDataTransaction {
|
||||
|
||||
success?()
|
||||
}
|
||||
withExtendedLifetime(self, {})
|
||||
}
|
||||
}
|
||||
|
||||
@@ -217,6 +220,10 @@ public final class CSUnsafeDataTransaction: CSBaseDataTransaction {
|
||||
|
||||
self.bridgeToSwift.context.saveAsynchronouslyWithCompletion { (hasChanges, error) in
|
||||
|
||||
defer {
|
||||
|
||||
withExtendedLifetime(self, {})
|
||||
}
|
||||
if let error = error {
|
||||
|
||||
completion?(SaveResult(error).bridgeToObjectiveC)
|
||||
@@ -225,7 +232,6 @@ public final class CSUnsafeDataTransaction: CSBaseDataTransaction {
|
||||
|
||||
completion?(SaveResult(hasChanges: hasChanges).bridgeToObjectiveC)
|
||||
}
|
||||
withExtendedLifetime(self, {})
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -63,7 +63,7 @@ public extension DataStack {
|
||||
|
||||
defer {
|
||||
|
||||
withExtendedLifetime(transaction, {})
|
||||
withExtendedLifetime((self, transaction), {})
|
||||
}
|
||||
let userInfo: T
|
||||
do {
|
||||
@@ -112,7 +112,7 @@ public extension DataStack {
|
||||
|
||||
defer {
|
||||
|
||||
withExtendedLifetime(transaction, {})
|
||||
withExtendedLifetime((self, transaction), {})
|
||||
}
|
||||
let userInfo: T
|
||||
do {
|
||||
|
||||
Reference in New Issue
Block a user