mirror of
https://github.com/JohnEstropia/CoreStore.git
synced 2026-03-24 18:31:41 +01:00
remove thread asserts when creating new transactions. fixes https://github.com/JohnEstropia/CoreStore/issues/6
This commit is contained in:
@@ -41,8 +41,6 @@ public extension DataStack {
|
|||||||
*/
|
*/
|
||||||
public func beginAsynchronous(closure: (transaction: AsynchronousDataTransaction) -> Void) {
|
public func beginAsynchronous(closure: (transaction: AsynchronousDataTransaction) -> Void) {
|
||||||
|
|
||||||
CoreStore.assert(NSThread.isMainThread(), "Attempted to begin a transaction from a \(typeName(self)) outside the main thread.")
|
|
||||||
|
|
||||||
AsynchronousDataTransaction(
|
AsynchronousDataTransaction(
|
||||||
mainContext: self.rootSavingContext,
|
mainContext: self.rootSavingContext,
|
||||||
queue: self.childTransactionQueue,
|
queue: self.childTransactionQueue,
|
||||||
@@ -57,8 +55,6 @@ public extension DataStack {
|
|||||||
*/
|
*/
|
||||||
public func beginSynchronous(closure: (transaction: SynchronousDataTransaction) -> Void) -> SaveResult? {
|
public func beginSynchronous(closure: (transaction: SynchronousDataTransaction) -> Void) -> SaveResult? {
|
||||||
|
|
||||||
CoreStore.assert(NSThread.isMainThread(), "Attempted to begin a transaction from a \(typeName(self)) outside the main thread.")
|
|
||||||
|
|
||||||
return SynchronousDataTransaction(
|
return SynchronousDataTransaction(
|
||||||
mainContext: self.rootSavingContext,
|
mainContext: self.rootSavingContext,
|
||||||
queue: self.childTransactionQueue,
|
queue: self.childTransactionQueue,
|
||||||
@@ -72,8 +68,6 @@ public extension DataStack {
|
|||||||
*/
|
*/
|
||||||
public func beginDetached() -> DetachedDataTransaction {
|
public func beginDetached() -> DetachedDataTransaction {
|
||||||
|
|
||||||
CoreStore.assert(NSThread.isMainThread(), "Attempted to begin a transaction from a \(typeName(self)) outside the main thread.")
|
|
||||||
|
|
||||||
return DetachedDataTransaction(
|
return DetachedDataTransaction(
|
||||||
mainContext: self.rootSavingContext,
|
mainContext: self.rootSavingContext,
|
||||||
queue: .Main)
|
queue: .Main)
|
||||||
|
|||||||
Reference in New Issue
Block a user