Skip to content

Commit

Permalink
Merge pull request #753 from bugsnag/tom/reinstate-guard-breadcrumbs-…
Browse files Browse the repository at this point in the history
…arraycopy

fix(breadcrumbs): further refactor of count into barrier guard
  • Loading branch information
tomlongridge authored Jul 14, 2020
2 parents 2e52665 + 3a4d5bb commit b85e5ef
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Bugsnag/Breadcrumbs/BugsnagBreadcrumbs.m
Original file line number Diff line number Diff line change
Expand Up @@ -116,9 +116,9 @@ - (NSArray *)cachedBreadcrumbs {
}

- (NSArray *)arrayValue {
__block NSMutableArray *contents =
[[NSMutableArray alloc] initWithCapacity:self.breadcrumbs.count];
__block NSMutableArray *contents;
dispatch_barrier_sync(self.readWriteQueue, ^{
contents = [[NSMutableArray alloc] initWithCapacity:self.breadcrumbs.count];
for (BugsnagBreadcrumb *crumb in self.breadcrumbs) {
NSDictionary *objectValue = [crumb objectValue];
NSError *error = nil;
Expand Down

0 comments on commit b85e5ef

Please sign in to comment.