Skip to content

Commit

Permalink
Merge pull request AFNetworking#28 from evanlong/master
Browse files Browse the repository at this point in the history
Fixing a leak as a result of a race condition in the sample Gowalla client
  • Loading branch information
Mattt Thompson committed Sep 15, 2011
2 parents 8d9b7ac + b681971 commit 78f1928
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions Example/Classes/AFGowallaAPIClient.m
Expand Up @@ -32,11 +32,10 @@
@implementation AFGowallaAPIClient

+ (id)sharedClient {
if (_sharedClient == nil) {
@synchronized(self) {
_sharedClient = [[self alloc] init];
}
}
static dispatch_once_t oncePredicate;
dispatch_once(&oncePredicate, ^{
_sharedClient = [[self alloc] init];
});

return _sharedClient;
}
Expand Down

0 comments on commit 78f1928

Please sign in to comment.