Skip to content

Commit

Permalink
Fixes a recursion bug introduced in the previous diff
Browse files Browse the repository at this point in the history
Summary:
Reverting the portion of the previous diff that attempted to reuse a reference as a bool,
given that the reference is assigned to late to be used to short-circuit recursion
  • Loading branch information
onebit committed Apr 13, 2012
1 parent 5077944 commit cf712da
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/Facebook.h
Expand Up @@ -36,6 +36,7 @@
NSString* _appId;
NSString* _urlSchemeSuffix;
NSArray* _permissions;
BOOL _isExtendingAccessToken;
FBRequest *_requestExtendingAccessToken;
NSDate* _lastAccessTokenUpdate;
FBFrictionlessRequestSettings* _frictionlessRequestSettings;
Expand Down
5 changes: 4 additions & 1 deletion src/Facebook.m
Expand Up @@ -347,9 +347,10 @@ - (void)authorize:(NSArray *)permissions {
* applicationDidBecomeActive: UIApplicationDelegate method.
*/
- (void)extendAccessToken {
if (_requestExtendingAccessToken) {
if (_isExtendingAccessToken) {
return;
}
_isExtendingAccessToken = YES;
NSMutableDictionary* params = [NSMutableDictionary dictionaryWithObjectsAndKeys:
@"auth.extendSSOAccessToken", @"method",
nil];
Expand Down Expand Up @@ -805,10 +806,12 @@ - (void)fbDialogNotLogin:(BOOL)cancelled {
// These delegate methods are only called for requests that extendAccessToken initiated

- (void)request:(FBRequest *)request didFailWithError:(NSError *)error {
_isExtendingAccessToken = NO;
_requestExtendingAccessToken = nil;
}

- (void)request:(FBRequest *)request didLoad:(id)result {
_isExtendingAccessToken = NO;
_requestExtendingAccessToken = nil;
NSString* accessToken = [result objectForKey:@"access_token"];
NSString* expTime = [result objectForKey:@"expires_at"];
Expand Down

0 comments on commit cf712da

Please sign in to comment.