Avoid deadlock in profile manager.

// FREEBIE
pull/1/head
Matthew Chen 8 years ago committed by Michael Kirk
parent b2ee64e701
commit 44051bd7e7

@ -243,6 +243,7 @@ const NSUInteger kOWSProfileManager_MaxAvatarDiameter = 640;
OWSAssert([userProfile isEqual:userProfileCopy]);
}
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
// Make sure to save on the local db connection for consistency.
[self.dbConnection readWriteWithBlock:^(YapDatabaseReadWriteTransaction *transaction) {
[userProfileCopy saveWithTransaction:transaction];
@ -280,6 +281,7 @@ const NSUInteger kOWSProfileManager_MaxAvatarDiameter = 640;
}];
}
});
});
}
- (void)ensureLocalProfileCached

Loading…
Cancel
Save