Merge pull request #28 from evanlong/master

Fixing a leak as a result of a race condition in the sample Gowalla client
This commit is contained in:
Mattt Thompson 2011-09-15 08:07:54 -07:00
commit 78f1928f4a

View file

@ -32,11 +32,10 @@ NSString * const kAFGowallaBaseURLString = @"https://api.gowalla.com/";
@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;
}