mirror of
https://github.com/modo-studio/SugarRecord.git
synced 2024-09-11 14:36:41 +03:00
Merge pull request #283 from v-ken/coredata_multithreading_violation_fix
Check for context changes within a performBlock
This commit is contained in:
commit
d9b02a8cea
@ -53,16 +53,16 @@ public class CoreDataDefaultStorage: Storage {
|
||||
catch {
|
||||
_error = error
|
||||
}
|
||||
if self.rootSavingContext.hasChanges {
|
||||
self.rootSavingContext.performBlockAndWait({
|
||||
self.rootSavingContext.performBlockAndWait({
|
||||
if self.rootSavingContext.hasChanges {
|
||||
do {
|
||||
try self.rootSavingContext.save()
|
||||
}
|
||||
catch {
|
||||
_error = error
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
})
|
||||
} catch {
|
||||
_error = error
|
||||
|
Loading…
Reference in New Issue
Block a user